@@ -51,6 +51,11 @@ public class EventPoint : MonoBehaviour
|
||||
}
|
||||
|
||||
public float value => FatherTab.scalevalue;
|
||||
public void Refresh()
|
||||
{
|
||||
ReDraw(value);
|
||||
UpdateValue();
|
||||
}
|
||||
public void ReDraw(float value)
|
||||
{
|
||||
|
||||
@@ -130,13 +135,7 @@ public class EventPoint : MonoBehaviour
|
||||
}
|
||||
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (RectTransformUtility.RectangleContainsScreenPoint(CurveCanvas.GetComponent<RectTransform>(), Mouse.current.position.ReadValue()))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
public void SelectButtonClick()//unity内:当按钮按下时
|
||||
{
|
||||
if (Keyboard.current.leftShiftKey.isPressed)
|
||||
@@ -187,7 +186,12 @@ public class EventPoint : MonoBehaviour
|
||||
FatherTab.FatherWindow.ConnectedPoint.EvDrawimage.color.b, 0.5f
|
||||
);
|
||||
}
|
||||
UpdateValue();
|
||||
|
||||
|
||||
}
|
||||
private void UpdateValue()
|
||||
{
|
||||
// 设置新的连接点并更新UI
|
||||
FatherTab.FatherWindow.ConnectedPoint = this;
|
||||
EvDrawimage.color = new Color(EvDrawimage.color.r, 0.75f, EvDrawimage.color.b, 1f);
|
||||
@@ -208,7 +212,6 @@ public class EventPoint : MonoBehaviour
|
||||
|
||||
FatherTab.FatherWindow.animationCurveTypeDropdown.onValueChanged.AddListener(value => FatherTab.FatherWindow.ChangeValue());
|
||||
}
|
||||
|
||||
// 添加静态方法:查找插入索引
|
||||
public static int FindInsertIndex(List<EventPoint> eventPoints, float startTime)
|
||||
{
|
||||
|
||||
@@ -221,18 +221,20 @@ public partial class GraphicalFlexibleFloatWindow
|
||||
}
|
||||
}
|
||||
}
|
||||
if (RectTransformUtility.RectangleContainsScreenPoint(GetComponent<RectTransform>(), Mouse.current.position.ReadValue()))
|
||||
if (ConnectedPoint != null && RectTransformUtility.RectangleContainsScreenPoint(GetComponent<RectTransform>(), Mouse.current.position.ReadValue()))
|
||||
{
|
||||
if (Keyboard.current.aKey.wasPressedThisFrame)
|
||||
{
|
||||
if (ConnectedPoint != null)
|
||||
{
|
||||
ConnectedPoint.animatedFloat.endValue *= -1;
|
||||
ConnectedPoint.animatedFloat.startValue *= -1;
|
||||
|
||||
ConnectedPoint.ReDraw(scalevalue);
|
||||
}
|
||||
|
||||
ConnectedPoint.animatedFloat.endValue *= -1;
|
||||
ConnectedPoint.animatedFloat.startValue *= -1;
|
||||
ConnectedPoint.Refresh();
|
||||
}
|
||||
if (Keyboard.current.sKey.wasPressedThisFrame)
|
||||
{
|
||||
float value = ConnectedPoint.animatedFloat.startValue;
|
||||
ConnectedPoint.animatedFloat.startValue = ConnectedPoint.animatedFloat.endValue;
|
||||
ConnectedPoint.animatedFloat.endValue = value;
|
||||
ConnectedPoint.Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user