【修复】叽里咕噜说啥呢听不懂

Signed-off-by: TRAfoer <lhf190@outlook.com>
This commit is contained in:
2025-08-14 21:27:15 +08:00
parent dc530472ba
commit a0b3dfe557
21 changed files with 221801 additions and 16196 deletions

View File

@@ -2,6 +2,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using DG.Tweening.Core.Easing;
using Ichni;
using Ichni.Editor;
using Ichni.RhythmGame;
@@ -309,4 +310,24 @@ public class FlexibleFloatTab : MonoBehaviour
FatherWindow.ConnectedPoint.Refresh(true);
EventPoint.Locked = false;
}
public void CutEvent()
{
EventPoint eventPoint = FatherWindow.ConnectedPoint;
if (eventPoint == null) return;
for (int i = 0; i < BeatNextDeviver; i++)
{
float segmentStartTime = eventPoint.animatedFloat.startTime + (eventPoint.animatedFloat.endTime - eventPoint.animatedFloat.startTime) / BeatNextDeviver * i;
float segmentEndTime = eventPoint.animatedFloat.startTime + (eventPoint.animatedFloat.endTime - eventPoint.animatedFloat.startTime) / BeatNextDeviver * (i + 1);
connectFloat.Add(new AnimatedFloat(
segmentStartTime,
segmentEndTime,
AnimationCurveEvaluator.Evaluate(eventPoint.animatedFloat.animationCurveType, (segmentStartTime - eventPoint.animatedFloat.startTime) / (eventPoint.animatedFloat.endTime - eventPoint.animatedFloat.startTime)) * (eventPoint.animatedFloat.endValue - eventPoint.animatedFloat.startValue) + eventPoint.animatedFloat.startValue,
AnimationCurveEvaluator.Evaluate(eventPoint.animatedFloat.animationCurveType, (segmentEndTime - eventPoint.animatedFloat.startTime) / (eventPoint.animatedFloat.endTime - eventPoint.animatedFloat.startTime)) * (eventPoint.animatedFloat.endValue - eventPoint.animatedFloat.startValue) + eventPoint.animatedFloat.startValue,
AnimationCurveType.Linear));
}
RemoveEventPoint(eventPoint);
connectFloat.Sort();
Initialize(connectFloat, Title);
FatherWindow.ChangeValue();
}
}

View File

@@ -247,6 +247,10 @@ public partial class GraphicalFlexibleFloatWindow
EventPoint.Locked = false;
}
}
else if (Keyboard.current.lKey.wasPressedThisFrame)
{
ConnectedPoint.FatherTab.CutEvent();
}
}
@@ -282,6 +286,7 @@ public partial class GraphicalFlexibleFloatWindow
}
}
}
public partial class GraphicalFlexibleFloatWindow
{//以后显示类写这里,别在叠大粪了

View File

@@ -3,6 +3,8 @@ using UnityEngine;
using Ichni.RhythmGame;
using UnityEngine.InputSystem;
using DG.Tweening;
using UniRx;
using UniRx.Triggers;
namespace Ichni.Editor
{
@@ -46,12 +48,19 @@ namespace Ichni.Editor
transform.localScale = Vector3.zero;
StartCoroutine(WindowAnim.ShowPanelOnScale(gameObject));
targetGameElement.OnDestroyAsObservable()
.Subscribe(_ =>
{
if (gameObject != null) Destroy(gameObject);
instance = null;
});
}
void Update()
{
if (isMoving) return;
if (isMoving) return;
transform.eulerAngles = targetGameElement.parentElement?.transform.eulerAngles ?? Vector3.zero;
transform.position = targetGameElement.transform.position;
if (Mouse.current.leftButton.wasPressedThisFrame)
{
@@ -144,13 +153,14 @@ namespace Ichni.Editor
// 应用新位置
Vector3 newPosition = initialTargetPosition + worldAxis * worldDelta;
Vector3 newPositionFormatted = new Vector3(
Mathf.Round(newPosition.x * 100f) / 100f,
Mathf.Round(newPosition.y * 100f) / 100f,
Mathf.Round(newPosition.z * 100f) / 100f
targetGameElement.transform.position = newPosition;
targetGameElement.transform.localPosition = new Vector3(
Mathf.Round(targetGameElement.transform.localPosition.x * 100f) / 100f,
Mathf.Round(targetGameElement.transform.localPosition.y * 100f) / 100f,
Mathf.Round(targetGameElement.transform.localPosition.z * 100f) / 100f
);
targetGameElement.transform.position = newPositionFormatted;
transform.position = newPositionFormatted;
transform.position = newPosition;
}
private Vector3 GetWorldAxis(int moveCode)