This commit is contained in:
2025-03-05 15:02:30 +08:00
parent 49bfc8e3de
commit 75d8d03275
6 changed files with 98 additions and 27 deletions
+13
View File
@@ -54,5 +54,18 @@ namespace AibisDream.SystemEditor
return SortingLayer.layers[idx].id;
}
public static void RecordObjectAndChildren(GameObject parent, string actionName)
{
Transform[] transforms = parent.GetComponentsInChildren<Transform>(true);
Object[] objectsToUndo = new Object[transforms.Length];
for (int i = 0; i < transforms.Length; i++)
{
objectsToUndo[i] = transforms[i].gameObject;
}
Undo.RegisterCompleteObjectUndo(objectsToUndo, actionName);
}
}
}