修改track复制步进和撤销模式

Signed-off-by: TRADER_FOER <lhf190@outlook.com>
This commit is contained in:
2026-07-10 14:05:45 +08:00
parent fdc20cd66f
commit a835e8321b
30 changed files with 1501 additions and 367 deletions

View File

@@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Ichni.Editor.Commands;
using Ichni.RhythmGame;
using Lean.Pool;
using UnityEngine;
@@ -784,29 +785,29 @@ namespace Ichni.Editor
builder
.Button("Displacement", () =>
Displacement.GenerateElement("New Displacement", Guid.NewGuid(),
CommandManager.ExecuteCreate(() => Displacement.GenerateElement("New Displacement", Guid.NewGuid(),
new List<string>(), true, gameElement,
new FlexibleFloat(true), new FlexibleFloat(true), new FlexibleFloat(true)))
new FlexibleFloat(true), new FlexibleFloat(true), new FlexibleFloat(true))))
.Button("Swirl", () =>
Swirl.GenerateElement("New Swirl", Guid.NewGuid(),
CommandManager.ExecuteCreate(() => Swirl.GenerateElement("New Swirl", Guid.NewGuid(),
new List<string>(), true, gameElement,
new FlexibleFloat(true), new FlexibleFloat(true), new FlexibleFloat(true)))
new FlexibleFloat(true), new FlexibleFloat(true), new FlexibleFloat(true))))
.Button("Scale", () =>
Scale.GenerateElement("New Scale", Guid.NewGuid(),
CommandManager.ExecuteCreate(() => Scale.GenerateElement("New Scale", Guid.NewGuid(),
new List<string>(), true, gameElement,
new FlexibleFloat(true), new FlexibleFloat(true), new FlexibleFloat(true)))
new FlexibleFloat(true), new FlexibleFloat(true), new FlexibleFloat(true))))
.Button("Look At", () =>
LookAt.GenerateElement("New Look At", Guid.NewGuid(),
new List<string>(), true, gameElement, null, new FlexibleBool()))
CommandManager.ExecuteCreate(() => LookAt.GenerateElement("New Look At", Guid.NewGuid(),
new List<string>(), true, gameElement, null, new FlexibleBool())))
.Button("Displacement Tracker", () =>
DisplacementTracker.GenerateElement("New Displacement Tracker", Guid.NewGuid(),
new List<string>(), true, gameElement, null, 0f))
CommandManager.ExecuteCreate(() => DisplacementTracker.GenerateElement("New Displacement Tracker", Guid.NewGuid(),
new List<string>(), true, gameElement, null, 0f)))
.Button("Swirl Tracker", () =>
SwirlTracker.GenerateElement("New Swirl Tracker", Guid.NewGuid(),
new List<string>(), true, gameElement, null, 0f))
CommandManager.ExecuteCreate(() => SwirlTracker.GenerateElement("New Swirl Tracker", Guid.NewGuid(),
new List<string>(), true, gameElement, null, 0f)))
.Button("Scale Tracker", () =>
ScaleTracker.GenerateElement("New Scale Tracker", Guid.NewGuid(),
new List<string>(), true, gameElement, null, 0f));
CommandManager.ExecuteCreate(() => ScaleTracker.GenerateElement("New Scale Tracker", Guid.NewGuid(),
new List<string>(), true, gameElement, null, 0f)));
}
// ════════════════════════════════════════════════════════

View File

@@ -4,6 +4,7 @@ using System.Collections.Generic;
using System.Threading.Tasks;
using DG.Tweening;
using Lean.Pool;
using Ichni.Editor.Commands;
using Ichni.RhythmGame;
using Unity.VisualScripting;
using UnityEngine;
@@ -24,7 +25,8 @@ namespace Ichni.Editor
tabList = new List<HierarchyTab>();
addFolderButton.onClick.AddListener(() =>
{
ElementFolder.GenerateElement("New Folder", Guid.NewGuid(), new List<string>(), true, null);
CommandManager.ExecuteCreate(() =>
ElementFolder.GenerateElement("New Folder", Guid.NewGuid(), new List<string>(), true, null));
});
expandButtom.onClick.AddListener(Expand);
rectTransform = this.GetComponent<RectTransform>();
@@ -201,4 +203,4 @@ namespace Ichni.Editor
upLoadElement = null;
}
}
}
}

View File

@@ -176,13 +176,7 @@ namespace Ichni.Editor
private void GenerateSaveClipWindow()
{
GameElement currentElement = EditorManager.instance.operationManager.currentSelectedElements[0];
if (currentElement == null)
{
LogWindow.Log("No Game Element selected.", Color.red);
return;
}
if (!TryGetSingleSelectedElementForClip(out GameElement currentElement)) return;
if (clipManagementWindow != null)
{
@@ -208,15 +202,7 @@ namespace Ichni.Editor
private void GenerateLoadClipWindow()
{
GameElement currentElement = EditorManager.instance.operationManager.currentSelectedElements[0];
if (currentElement == null)
{
LogWindow.Log("No Game Element selected.", Color.red);
return;
}
GameElement loadTarget = currentElement == EditorManager.instance ? null : currentElement.parentElement;
if (!TryGetSingleSelectedElementForClip(out GameElement currentElement)) return;
if (clipManagementWindow != null)
{
@@ -240,6 +226,26 @@ namespace Ichni.Editor
});
}
private bool TryGetSingleSelectedElementForClip(out GameElement currentElement)
{
currentElement = null;
var selectedElements = EditorManager.instance.operationManager.currentSelectedElements;
if (selectedElements == null || selectedElements.Count != 1)
{
LogWindow.Log("Please select only one Game Element for clip operation.", Color.red);
return false;
}
currentElement = selectedElements[0];
if (currentElement == null)
{
LogWindow.Log("No Game Element selected.", Color.red);
return false;
}
return true;
}
private void GenerateMergeWindow()
{
GeneralSecondaryWindow mergeWindow = Instantiate(EditorManager.instance.basePrefabs.generalSecondaryWindow,