Signed-off-by: TRAfoer <lhf190@outlook.com>
This commit is contained in:
2025-07-23 11:40:29 +08:00
parent 2dae60d368
commit 6d010467ae
60 changed files with 196637 additions and 17425 deletions

View File

@@ -265,4 +265,48 @@ public class FlexibleFloatTab : MonoBehaviour
Destroy(eventPoint.gameObject);
}
}
public IEnumerator Draging()
{
EventPoint.Locked = true;
while (Keyboard.current.uKey.isPressed)
{
bool changed = false;
var point = FatherWindow.ConnectedPoint;
if (Mouse.current.leftButton.isPressed)
{
point.animatedFloat.startTime = GetBeat();
changed = true;
}
else if (Mouse.current.rightButton.isPressed)
{
point.animatedFloat.endTime = GetBeat();
changed = true;
}
if (changed)
{
// 保证时间顺序
if (point.animatedFloat.startTime >= point.animatedFloat.endTime)
{
if (Mouse.current.leftButton.isPressed)
point.animatedFloat.endTime = point.animatedFloat.startTime + 0.1f;
else
point.animatedFloat.startTime = point.animatedFloat.endTime - 0.1f;
}
// 保证不超过下一个事件点
if (point.NextEventPoint != null && point.animatedFloat.endTime > point.NextEventPoint.animatedFloat.startTime)
{
if (Mouse.current.leftButton.isPressed)
point.animatedFloat.endTime = point.NextEventPoint.animatedFloat.startTime;
else
point.animatedFloat.startTime = point.NextEventPoint.animatedFloat.startTime - 0.1f;
}
point.Initialize(point.animatedFloat);
point.UpdateValue();
}
yield return null;
}
FatherWindow.ConnectedPoint.Refresh(true);
EventPoint.Locked = false;
}
}