using UnityEditor; using UnityEngine; namespace VertexColor.ScenePartition.Editor { public static class ScenePartitionMenuEditor { [MenuItem("GameObject/CopyFileId", false, 10000)] public static void CreateTextArea5() { GameObject go = Selection.activeGameObject; if (go == null) return; GlobalObjectId id = GlobalObjectId.GetGlobalObjectIdSlow(go); if (id.targetPrefabId == 0) // 0 = no prefab. { EditorGUIUtility.systemCopyBuffer = id.targetObjectId.ToString(); Debug.Log($"object id: {id.targetObjectId}"); } else { EditorGUIUtility.systemCopyBuffer = id.targetPrefabId.ToString(); Debug.Log($"object id: {id.targetPrefabId}"); } } } }