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

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

@@ -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)