事件编辑器初步
待办: 添加删除 复制粘贴 曲线预览
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using Ichni;
|
||||
using Ichni.RhythmGame;
|
||||
using UnityEngine;
|
||||
|
||||
public class FlexibleFloatTab : MonoBehaviour
|
||||
{
|
||||
public FlexibleFloat flexibleFloat;
|
||||
|
||||
public GraphicalFlexibleFloatWindow FatherWindow;
|
||||
|
||||
public List<EventPoint> eventPoints;
|
||||
|
||||
public RectTransform Area;
|
||||
public RectTransform BeatArea;
|
||||
|
||||
public EventPoint eventPoint;
|
||||
public GameObject BeatLine;
|
||||
|
||||
public int BeatDeviver => FatherWindow.BeatDeviver;
|
||||
public void Initialize(FlexibleFloat flexibleFloat, string Title)
|
||||
{
|
||||
for (int i = 0; i < (int)EditorManager.instance.songInformation.song.length / FatherWindow.timePerBeat; i++)
|
||||
{
|
||||
GameObject u = Instantiate(BeatLine, BeatArea);
|
||||
u.transform.localPosition = new Vector3(BeatDeviver * i, 0, 0);
|
||||
}
|
||||
for (int i = 0; i <= flexibleFloat.animations.Count - 1; i++)
|
||||
{
|
||||
AnimatedFloat animatedFloat = flexibleFloat.animations[i];
|
||||
EventPoint eventPoint = Instantiate(this.eventPoint, Area);
|
||||
eventPoint.FatherTab = this;
|
||||
eventPoint.Initialize(animatedFloat);
|
||||
eventPoints.Add(eventPoint);
|
||||
if (i - 1 >= 0)
|
||||
{
|
||||
eventPoint.LastEventPoint = eventPoints[i - 1];
|
||||
eventPoint.LastEventPoint.NextEventPoint = eventPoint;
|
||||
}
|
||||
else eventPoint.LastEventPoint = null;
|
||||
if (i == flexibleFloat.animations.Count - 1) eventPoint.NextEventPoint = null;
|
||||
|
||||
|
||||
|
||||
}
|
||||
Area.localPosition = new Vector3(FatherWindow.songBeat * BeatDeviver, 0, 0);
|
||||
}
|
||||
public void Update()
|
||||
{
|
||||
|
||||
Area.localPosition = new Vector3(-FatherWindow.songBeat * BeatDeviver, 0, 0);
|
||||
BeatArea.localPosition = Area.localPosition;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user