复制粘贴删除

This commit is contained in:
SoulliesOfficial
2025-02-19 19:01:21 -05:00
parent 28e8d54a7b
commit 0d69138e1b
11 changed files with 190 additions and 45 deletions

View File

@@ -206,7 +206,6 @@ namespace Ichni.RhythmGame
public override void ExecuteBM()
{
attachedElement = GameElement_BM.GetElement(attachedElementGuid);
Debug.Log(attachedElementGuid);
(attachedElement as IHaveTransformSubmodule).transformSubmodule = new TransformSubmodule(attachedElement, originalPosition, originalEulerAngles, originalScale);
attachedElement.submoduleList.Add((attachedElement as IHaveTransformSubmodule).transformSubmodule);
}

View File

@@ -124,7 +124,7 @@ namespace Ichni.RhythmGame
/// </summary>
public virtual void Delete()
{
if (this.childElementList != null)
if (childElementList is { Count: > 0 })
{
for (int i = 0; i < childElementList.Count; i++)
{
@@ -133,13 +133,16 @@ namespace Ichni.RhythmGame
}
OnDelete();
#if UNITY_EDITOR
Debug.Log("Delete " + elementName + "(" + elementGuid + ")");
#endif
LogWindow.Log("Deleted element: " + elementName);
EditorManager.instance.beatmapContainer.gameElementList.Remove(this); //从保存列表中剔除
this.parentElement.childElementList.Remove(this);
Destroy(connectedTab.gameObject);
if (connectedTab != null)
{
Destroy(connectedTab.gameObject);
}
Destroy(gameObject); //销毁
}
}