@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -234,34 +234,34 @@ public class SampleWindow : MovableWindow//该window高度为300,横的要XWid
|
||||
far -= 1f / Xdevide;
|
||||
float time = far * timePerBeat;
|
||||
|
||||
;
|
||||
|
||||
switch (NoteCode)
|
||||
{
|
||||
case 0:
|
||||
Tap a = Tap.GenerateElement("New Tap", Guid.NewGuid(), new List<string>(), true, gameElement, time);
|
||||
noteBases.Add(a);
|
||||
a.noteVisual.transformSubmodule.originalPosition = new Vector3(localMousePosition.x / XWidth, 0f, 0f);
|
||||
a.noteVisual.transformSubmodule.originalPosition = new Vector3(isExpand ? (localMousePosition.x / XWidth) : 0f, 0f, 0f);
|
||||
a.noteVisual.transformSubmodule.Refresh();
|
||||
SpawnNote(a, isExpand ? localMousePosition.x : 0f);
|
||||
break;
|
||||
case 3:
|
||||
Hold b = Hold.GenerateElement("New Hold", Guid.NewGuid(), new List<string>(), true, gameElement, time, time + 0.5f);
|
||||
noteBases.Add(b);
|
||||
b.noteVisual.transformSubmodule.originalPosition = new Vector3(localMousePosition.x / XWidth, 0f, 0f);
|
||||
b.noteVisual.transformSubmodule.originalPosition = new Vector3(isExpand ? (localMousePosition.x / XWidth) : 0f, 0f, 0f);
|
||||
b.noteVisual.transformSubmodule.Refresh();
|
||||
SpawnNote(b, isExpand ? localMousePosition.x : 0f);
|
||||
break;
|
||||
case 1:
|
||||
Stay c = Stay.GenerateElement("New Stay", Guid.NewGuid(), new List<string>(), true, gameElement, time);
|
||||
noteBases.Add(c);
|
||||
c.noteVisual.transformSubmodule.originalPosition = new Vector3(localMousePosition.x / XWidth, 0f, 0f);
|
||||
c.noteVisual.transformSubmodule.originalPosition = new Vector3(isExpand ? (localMousePosition.x / XWidth) : 0f, 0f, 0f);
|
||||
c.noteVisual.transformSubmodule.Refresh();
|
||||
SpawnNote(c, isExpand ? localMousePosition.x : 0f);
|
||||
break;
|
||||
case 2:
|
||||
Flick d = Flick.GenerateElement("New Flick", Guid.NewGuid(), new List<string>(), true, gameElement, time, new List<Vector2>());
|
||||
noteBases.Add(d);
|
||||
d.noteVisual.transformSubmodule.originalPosition = new Vector3(localMousePosition.x / XWidth, 0f, 0f);
|
||||
d.noteVisual.transformSubmodule.originalPosition = new Vector3(isExpand ? (localMousePosition.x / XWidth) : 0f, 0f, 0f);
|
||||
d.noteVisual.transformSubmodule.Refresh();
|
||||
SpawnNote(d, isExpand ? localMousePosition.x : 0f);
|
||||
break;
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f613492402ff5f2449535cf8161474ef
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,28 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Dreamteck.Splines;
|
||||
using Ichni.RhythmGame;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
|
||||
public class TrackNoteEditor : MonoBehaviour
|
||||
{
|
||||
public SplineRenderer splineRenderer;
|
||||
public SplineComputer splineComputer;
|
||||
public int BeatDevider = 4; // 节拍分割数
|
||||
|
||||
public Track Track;
|
||||
public void Initialize(Track track)
|
||||
{
|
||||
Track = track;
|
||||
Track.trackNoteEditor = this;
|
||||
// 初始化其他相关组件或数据
|
||||
UnityEditorInternal.ComponentUtility.CopyComponent(Track.trackPathSubmodule.path);
|
||||
UnityEditorInternal.ComponentUtility.PasteComponentAsNew(gameObject);
|
||||
splineComputer = GetComponent<SplineComputer>();
|
||||
if (Track.trackTimeSubmodule is TrackTimeSubmoduleMovable movable)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c643f60e3c1d85543a8835265334bd58
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user