Skip to content

Instantly share code, notes, and snippets.

@SteveSwink
Created May 22, 2015 23:09
Show Gist options
  • Save SteveSwink/c27395d13d7f9e582092 to your computer and use it in GitHub Desktop.
Save SteveSwink/c27395d13d7f9e582092 to your computer and use it in GitHub Desktop.
using UnityEditor;
[CustomEditor( typeof( Guid ) )]
class GuidInspector : Editor
{
void OnEnable()
{
Guid guid = (Guid)target;
if ( guid.guid == System.Guid.Empty )
{
guid.Generate();
EditorUtility.SetDirty( target );
}
}
public override void OnInspectorGUI()
{
Guid guid = (Guid)target;
EditorGUILayout.SelectableLabel( guid.guid.ToString() );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment