Skip to content

Instantly share code, notes, and snippets.

@celoron
Last active August 28, 2017 17:29
Show Gist options
  • Select an option

  • Save celoron/6f4c6e0602b96f4b0c8117e078b538c6 to your computer and use it in GitHub Desktop.

Select an option

Save celoron/6f4c6e0602b96f4b0c8117e078b538c6 to your computer and use it in GitHub Desktop.
Unity Custom Inspector
using UnityEngine;
using System.Collections;
using UnityEditor;
[CustomEditor(typeof(LevelScript))]
public class LevelScriptEditor : Editor
{
public override void OnInspectorGUI()
{
LevelScript myTarget = (LevelScript)target;
myTarget.experience = EditorGUILayout.IntField("Experience", myTarget.experience);
EditorGUILayout.LabelField("Level", myTarget.Level.ToString());
DrawDefaultInspector ();
}
void OnSceneGUI( )
{
Handles.Label(target.transform.position, "Node");
// can access handles
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment