coldcoldfix
This commit is contained in:
@@ -24,6 +24,7 @@ public class FlexibleFloatTab : MonoBehaviour
|
||||
public FlexibleFloat connectFloat;
|
||||
public int BeatDeviver => FatherWindow.BeatDeviver;
|
||||
public int BeatNextDeviver => FatherWindow.BeatNextDeviver;
|
||||
public bool linked = false;//TODOTODO!
|
||||
|
||||
// 初始化函数
|
||||
public void Initialize(FlexibleFloat flexibleFloat, string title)
|
||||
@@ -36,7 +37,6 @@ public class FlexibleFloatTab : MonoBehaviour
|
||||
CreateBeatLines();
|
||||
CreateEventPoints();
|
||||
Area.localPosition = new Vector3(FatherWindow.songBeat * BeatDeviver, 0, 0);
|
||||
TabButton.onClick.AddListener(AddEvent);
|
||||
}
|
||||
|
||||
// 清除子节点
|
||||
@@ -91,6 +91,12 @@ public class FlexibleFloatTab : MonoBehaviour
|
||||
// 更新函数
|
||||
public void Update()
|
||||
{
|
||||
bool isOnEv = false;
|
||||
foreach (var i in eventPoints)
|
||||
{
|
||||
isOnEv = RectTransformUtility.RectangleContainsScreenPoint(i.selectButton.GetComponent<RectTransform>(), Mouse.current.position.ReadValue());
|
||||
if (isOnEv) break;
|
||||
}
|
||||
Vector3 newPosition = new Vector3(-FatherWindow.songBeat * BeatDeviver, 0, 0);
|
||||
Area.localPosition = newPosition;
|
||||
BeatArea.localPosition = newPosition;
|
||||
@@ -103,11 +109,17 @@ public class FlexibleFloatTab : MonoBehaviour
|
||||
}
|
||||
}
|
||||
XBeatArea.localPosition = BeatArea.localPosition;
|
||||
if (RectTransformUtility.RectangleContainsScreenPoint(TabButton.GetComponent<RectTransform>(), Mouse.current.position.ReadValue()))
|
||||
if (!isOnEv && Mouse.current.leftButton.wasPressedThisFrame)
|
||||
{
|
||||
AddEvent();
|
||||
}
|
||||
}
|
||||
|
||||
// 添加事件
|
||||
public void AddEvent()
|
||||
{
|
||||
|
||||
if (Keyboard.current.ctrlKey.isPressed)
|
||||
{
|
||||
EventPoint eventPoint = Instantiate(this.eventPoint, Area);
|
||||
@@ -115,17 +127,17 @@ public class FlexibleFloatTab : MonoBehaviour
|
||||
eventPoint.Initialize(new AnimatedFloat(GetBeat(),
|
||||
GetBeat() + (float.Parse(FatherWindow.EventMultiplier.text) * FatherWindow.timePerBeat), 0, 0, AnimationCurveType.Linear));
|
||||
eventPoints.Insert(FindInsertIndex(eventPoint.animatedFloat.startTime), eventPoint);
|
||||
LinkNewEventPoint(eventPoint, true);
|
||||
LinkNewEventPoint(eventPoint, linked);
|
||||
eventPoint.ReDraw(scalevalue);
|
||||
eventPoint.selectButton.onClick.Invoke();
|
||||
FatherWindow.ChangeValue();
|
||||
connectFloat.Add(eventPoint.animatedFloat);
|
||||
connectFloat.Sort();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (FatherWindow.ConnectedPoint != null) FatherWindow.ConnectedPoint.UpLoad();
|
||||
}
|
||||
// else
|
||||
// {
|
||||
// if (FatherWindow.ConnectedPoint != null) FatherWindow.ConnectedPoint.UpLoad();
|
||||
// }
|
||||
}
|
||||
public void SpawnEvent(AnimatedFloat animatedFloat)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user