We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2296f02 commit a39816fCopy full SHA for a39816f
1 file changed
Assets/Scripts/Editor/BatchTools/CopyGameObjectNames.cs
@@ -3,6 +3,7 @@
3
using UnityEngine;
4
using UnityEditor;
5
using System.Text;
6
+using System.Linq;
7
namespace UnityLibrary.Tools
8
{
9
public class CopyGameObjectNames : EditorWindow
@@ -38,7 +39,10 @@ private void FetchNames()
38
39
StringBuilder sb = new StringBuilder();
40
GameObject[] selectedObjects = Selection.gameObjects;
41
- foreach (GameObject obj in selectedObjects)
42
+ // Sort the selected objects by their sibling index
43
+ var sortedObjects = selectedObjects.OrderBy(go => go.transform.GetSiblingIndex()).ToArray();
44
+
45
+ foreach (GameObject obj in sortedObjects)
46
47
sb.AppendLine(obj.name);
48
}
@@ -52,4 +56,4 @@ private void CopyToClipboard()
52
56
Debug.Log("GameObject names copied to clipboard.");
53
57
54
58
55
-}
59
+}
0 commit comments