generated from max/template-unity-project
GameObject menu copy file Id
- GameObject menu copy file id
This commit is contained in:
parent
41df190afb
commit
ddf71ef7d7
29
Editor/ScenePartitionMenuEditor.cs
Normal file
29
Editor/ScenePartitionMenuEditor.cs
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
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}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
Editor/ScenePartitionMenuEditor.cs.meta
Normal file
11
Editor/ScenePartitionMenuEditor.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ab63a69b46a3ff4438723520d0656c93
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
Loading…
Reference in New Issue
Block a user