Last active
August 28, 2017 17:29
-
-
Save celoron/6f4c6e0602b96f4b0c8117e078b538c6 to your computer and use it in GitHub Desktop.
Unity Custom Inspector
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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