From 039bc5bddf474164cefaec2ccd4672c6cddd272c Mon Sep 17 00:00:00 2001
From: SoulliesOfficial <77235731+SoulliesOfficial@users.noreply.github.com>
Date: Thu, 20 Feb 2025 19:36:49 -0500
Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E4=B8=AA=E6=B3=A8=E9=87=8A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Base/GeneralSubmodules/SubmoduleBase.cs | 1 +
Assets/Scripts/Manager/OperationManager.cs | 12 ++++++++----
Assets/StreamingAssets/.DS_Store | Bin 8196 -> 8196 bytes
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/Assets/Scripts/EditorGame/Base/GeneralSubmodules/SubmoduleBase.cs b/Assets/Scripts/EditorGame/Base/GeneralSubmodules/SubmoduleBase.cs
index efba78de..8d40426e 100644
--- a/Assets/Scripts/EditorGame/Base/GeneralSubmodules/SubmoduleBase.cs
+++ b/Assets/Scripts/EditorGame/Base/GeneralSubmodules/SubmoduleBase.cs
@@ -29,6 +29,7 @@ namespace Ichni.RhythmGame
public virtual void Delete()
{
+ OnDelete();
attachedGameElement.submoduleList.Remove(this);
}
diff --git a/Assets/Scripts/Manager/OperationManager.cs b/Assets/Scripts/Manager/OperationManager.cs
index 4e3d79d7..0d6ca228 100644
--- a/Assets/Scripts/Manager/OperationManager.cs
+++ b/Assets/Scripts/Manager/OperationManager.cs
@@ -58,13 +58,19 @@ namespace Ichni.Editor
if (gameElement.parentElement != null)
{
- gameElement.parentElement.childElementList.Remove(gameElement);
+ gameElement.parentElement.childElementList.Remove(gameElement); //从父物体的子物体列表中移除,避免报null
}
gameElement.Delete();
}
- private GameElement AffiliatedPaste(GameElement gameElement, GameElement parent)
+ ///
+ /// 使用递归的方式复制粘贴物体及其所有子物体
+ ///
+ /// 将要被粘贴的物体
+ /// (将要)被粘贴物体的父物体
+ ///
+ private void AffiliatedPaste(GameElement gameElement, GameElement parent)
{
gameElement.SaveBM();
GameElement pastedElement = (gameElement.matchedBM as GameElement_BM).DuplicateBM(parent);
@@ -82,8 +88,6 @@ namespace Ichni.Editor
AffiliatedPaste(gameElement.childElementList[i], pastedElement);
}
}
-
- return pastedElement;
}
}
}
\ No newline at end of file
diff --git a/Assets/StreamingAssets/.DS_Store b/Assets/StreamingAssets/.DS_Store
index 156b1dbbc3f887e426fefbdc6b5c329f2a6b2449..c577c1b1718817bdf00366bc68fae4a2e5fbe6c2 100644
GIT binary patch
delta 28
jcmZp1XmQwZP=w#u!mw6Hq1wX4R7b(sz-03U5fg3zg764e
delta 20
bcmZp1XmQwZP=wjY#B%a2A^XkDqKw=COwtBL