文档,给那些工具挪窝
This commit is contained in:
8
Assets/Scripts/Graphical Tools.meta
Normal file
8
Assets/Scripts/Graphical Tools.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2aebeab4fb1481a44b0657cfc12def90
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,44 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni;
|
||||
using Ichni.RhythmGame;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class NotefabContoler : MonoBehaviour
|
||||
{
|
||||
public NoteBase noteBase;
|
||||
public RawImage ifHold;
|
||||
public void Initialize(NoteBase note, float timePerBeat, int beatDeviver)
|
||||
{
|
||||
noteBase = note;
|
||||
Image color = GetComponent<Image>();
|
||||
transform.localPosition = new Vector3(0, note.exactJudgeTime / timePerBeat * beatDeviver, 0);
|
||||
switch (note)
|
||||
{
|
||||
case Hold hold:
|
||||
color.color = new Color(0, 1, 0, 1);
|
||||
if (ifHold != null)
|
||||
{
|
||||
ifHold.transform.localPosition = new Vector3(0, (hold.holdEndTime - hold.exactJudgeTime) / timePerBeat * beatDeviver / 2, 0);
|
||||
var rect = ifHold.GetComponent<RectTransform>();
|
||||
rect.sizeDelta = new Vector2(rect.sizeDelta.x, (hold.holdEndTime - hold.exactJudgeTime) / timePerBeat * beatDeviver);
|
||||
ifHold.color = new Color(0, 1, 0, 1);
|
||||
}
|
||||
break;
|
||||
case Tap:
|
||||
color.color = new Color(0, 1, 1, 1);
|
||||
break;
|
||||
case Stay:
|
||||
color.color = new Color(1, 1, 0, 1);
|
||||
break;
|
||||
case Flick:
|
||||
color.color = new Color(1, 0.2f, 0, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
public void Onclick()
|
||||
{
|
||||
EditorManager.instance.uiManager.hierarchy.FindTab(noteBase);
|
||||
}
|
||||
}
|
||||
@@ -123,31 +123,7 @@ public class SampleWindow : MovableWindow//该window高度为300,横的要在1
|
||||
private void SpawnNote(NoteBase i, float posx = 0)
|
||||
{
|
||||
GameObject u = Instantiate(NotePrefab, NoteMovepoint);
|
||||
u.transform.localPosition = new Vector3(0, i.exactJudgeTime / timePerBeat * beatDeviver, 0);
|
||||
Image color = u.GetComponent<Image>();
|
||||
u.GetComponent<NotefabContoler>().noteBase = i;
|
||||
switch (i)
|
||||
{
|
||||
case Hold hold:
|
||||
color.color = new Color(0, 1, 0, 1);
|
||||
RawImage a = u.GetComponent<NotefabContoler>().ifHold;
|
||||
a.transform.localPosition = new Vector3(0, (hold.holdEndTime - hold.exactJudgeTime) / timePerBeat * beatDeviver / 2, 0);
|
||||
a.GetComponent<RectTransform>().sizeDelta = new Vector2(a.GetComponent<RectTransform>().sizeDelta.x, (hold.holdEndTime - hold.exactJudgeTime) / timePerBeat * beatDeviver);
|
||||
a.color = new Color(0, 1, 0, 1);
|
||||
break;
|
||||
|
||||
case Tap:
|
||||
color.color = new Color(0, 1, 1, 1);
|
||||
break;
|
||||
|
||||
case Stay:
|
||||
color.color = new Color(1, 1, 0, 1);
|
||||
break;
|
||||
|
||||
case Flick:
|
||||
color.color = new Color(1, 0.2f, 0, 1);
|
||||
break;
|
||||
}//服了,之后整合到controler里头去
|
||||
u.GetComponent<NotefabContoler>().Initialize(i, timePerBeat, beatDeviver);
|
||||
}
|
||||
|
||||
public GameObject selectedGameObject;
|
||||
@@ -1,16 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni;
|
||||
using Ichni.RhythmGame;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class NotefabContoler : MonoBehaviour
|
||||
{
|
||||
public NoteBase noteBase;
|
||||
public RawImage ifHold;
|
||||
public void Onclick()
|
||||
{
|
||||
EditorManager.instance.uiManager.hierarchy.FindTab(noteBase);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user