体验优化

Signed-off-by: TRAfoer <lhf190@outlook.com>
This commit is contained in:
2025-07-19 13:52:42 +08:00
parent f59aea9bf5
commit eeecba5a3e
16 changed files with 16421 additions and 17768 deletions

View File

@@ -134,7 +134,7 @@ namespace Ichni.Editor
}
EditorManager.instance.uiManager.inspector.SetInspector(connectedGameElement);
EditorManager.instance.timeline.SetTimeLine(connectedGameElement);
}
public IEnumerator ienumerator = null;
public void ExpandOrFold()

View File

@@ -13,6 +13,7 @@ namespace Ichni.Editor
{
public GameElement connectedGameElement;
public Canvas inspectorCanvas;
public Canvas mainCanvas;
public RectTransform inspectorRect;
public RectTransform WindowRect { get; set; }
@@ -37,6 +38,7 @@ namespace Ichni.Editor
ClearInspector();
connectedGameElement = gameElement;
connectedGameElement.SetUpInspector();
EditorManager.instance.uiManager.timeline.SetTimeLine(gameElement);
}
public void ClearInspector()

View File

@@ -17,9 +17,11 @@ public class SubTab : MonoBehaviour
private TimePointerModule timePointerModule;
public TimelineTab father;
private Timeline timeline;
public RawImage ProgressImage;
public RectTransform anotherTab;//Last
public float time;
public void Set(IBaseElement Objs, float time)
public void Set(IBaseElement Objs, float time, RectTransform anotherTab = null)
{
songInformation = EditorManager.instance.songInformation;
timePointerModule = EditorManager.instance.uiManager.timeline.timePointerModule;
@@ -27,10 +29,19 @@ public class SubTab : MonoBehaviour
this.time = time;
connectObj.Add(Objs);
button.GetComponentInChildren<TMP_Text>().text = connectObj.Count().ToString();
if (anotherTab != null)
{
this.anotherTab = anotherTab;
ProgressImage.GetComponent<RectTransform>().sizeDelta = new Vector2((time - anotherTab.GetComponent<SubTab>().time) / timeline.timePerBeat * timePointerModule.timePointerInterval, ProgressImage.GetComponent<RectTransform>().sizeDelta.y);
button.GetComponentInChildren<TMP_Text>().text = "E";
anotherTab.GetComponent<SubTab>().button.GetComponentInChildren<TMP_Text>().text = "S";
}
transform.localPosition = new Vector3((this.time / timeline.timePerBeat * timePointerModule.timePointerInterval),
-(42.5f + ((father.TabIndex + 1) * 25)), 0);
//transform.position = new Vector3(transform.position.x, father.Title.transform.position.y + 12, 0);
button.onClick.AddListener(GetClick);
}
void Update()
{
@@ -39,17 +50,17 @@ public class SubTab : MonoBehaviour
transform.localScale = new Vector3(time > songInformation.songTime ? 1f : 0f, 1f, 1f);
}
}
// public void GetClick()//?
// {
// if (connectObj[0] is GameElement)
// {
// EditorManager.instance.uiManager.hierarchy.FindTab((GameElement)connectObj[0]);
// }
// else
// {
// EditorManager.instance.uiManager.hierarchy.FindTab(((SubmoduleBase)connectObj[0]).attachedGameElement);
// }
// }
public void GetClick()//?
{
if (connectObj[0] is GameElement)
{
EditorManager.instance.uiManager.hierarchy.FindTab((GameElement)connectObj[0]);
}
else
{
EditorManager.instance.uiManager.hierarchy.FindTab(((SubmoduleBase)connectObj[0]).attachedGameElement);
}
}
}

View File

@@ -44,6 +44,17 @@ namespace Ichni.Editor
timePointer.index = i;
timePointer.gameObject.SetActive(false);
}
// for (int i = -1; i > -songInformation.delay / timeline.timePerBeat; i--)
// {
// TimePointer timePointer = Instantiate(timePointerPrefab, timePointerContainer).GetComponent<TimePointer>();
// timePointerList.Insert(0, timePointer);
// timePointer.intervalUnitText.text = (i * timeline.timePerBeat).ToString("F3");
// timePointer.GetComponent<RectTransform>().localPosition = new Vector3(i * timePointerInterval, 0f, 0f);
// timePointer.index = i;
// timePointer.gameObject.SetActive(false);
// }
}
public void SortPos()
{

View File

@@ -32,6 +32,7 @@ namespace Ichni.Editor
public TMP_InputField BeatField;
public RectTransform GetinputArea;
public void Update()
{
if (EditorManager.instance.musicPlayer.isPlaying) UpdateTime();
@@ -91,7 +92,7 @@ namespace Ichni.Editor
BeatField.text = songBeat.ToString("F2");
}
private Tweener _activeTweener; // 保存当前动画的引用
private Tweener _activeTweener = null; // 保存当前动画的引用
public void SetTime(string time)
{
EditorManager.instance.musicPlayer.PauseMusic();

View File

@@ -39,15 +39,15 @@ public class TimelineTab : MonoBehaviour
if (gameElement is TimeDurationSubmodule suba)
{
AddSubTab(suba, suba.startTime);
AddSubTab(suba, suba.endTime);
var s = AddSubTab(suba, suba.startTime);
AddSubTab(suba, suba.endTime, s.GetComponent<RectTransform>());
}
else if (gameElement is TrackTimeSubmodule sub)
{
if (sub is TrackTimeSubmoduleMovable moveable)
{
AddSubTab(moveable, moveable.trackStartTime);
AddSubTab(moveable, moveable.trackEndTime);
var s = AddSubTab(moveable, moveable.trackStartTime);
AddSubTab(moveable, moveable.trackEndTime, s.GetComponent<RectTransform>());
}
}
else if (gameElement is NoteBase)
@@ -65,13 +65,13 @@ public class TimelineTab : MonoBehaviour
}
}
private void AddSubTab(IBaseElement element, float time)
private SubTab AddSubTab(IBaseElement element, float time, RectTransform anotherTab = null)
{
SubTab subTab = Instantiate(ElementPrefab, MoveArea.transform);
subTab.father = this;
subTab.Set(element, time);
subTab.Set(element, time, anotherTab);
SubTabs.Add(time, subTab);
return subTab;
}
private void Start()

View File

@@ -18,7 +18,14 @@ namespace Ichni.RhythmGame
public void SelectGameElement()
{
EditorManager.instance.uiManager.hierarchy.FindTab(elementToSelect);
if (EditorManager.instance.uiManager.inspector.connectedGameElement == this.elementToSelect)
{
EditorManager.instance.uiManager.hierarchy.FindTab(elementToSelect.parentElement);
}
else
{
EditorManager.instance.uiManager.hierarchy.FindTab(elementToSelect);
}
// EditorManager.instance.operationManager.ClearSelectedElements();
// EditorManager.instance.operationManager.AddSelectElement(elementToSelect);
// EditorManager.instance.uiManager.inspector.SetInspector(elementToSelect);

View File

@@ -52,6 +52,7 @@ namespace Ichni.RhythmGame
EditorManager.instance.uiManager.inspector.ClearInspector();
SetUpInspector();
});
}
private AudioClip LoadMP3(string filepath)//猜猜我从哪里偷的
{

View File

@@ -89,8 +89,7 @@ namespace Ichni
}
isLoaded = true;
songInformation.songTime = musicPlayer.audioSource.time - songInformation.offset;
}
public float CurrentFrameRate;
public TMP_Text FPStext;