@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user