文档,给那些工具挪窝

This commit is contained in:
2025-06-07 00:01:54 +08:00
parent 4497c3b3da
commit 26e5d302be
38 changed files with 408 additions and 1821 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2aebeab4fb1481a44b0657cfc12def90
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -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);
}
}

View File

@@ -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;

View File

@@ -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);
}
}