Last active
June 13, 2017 03:46
-
-
Save KRNKRS/7c9137ea2cfc234a9b6f821dc059b9b8 to your computer and use it in GitHub Desktop.
This file contains 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
public class Hoge | |
{ | |
public int intValue1; | |
public int intValue2; | |
} | |
#if UNITY_EDITOR | |
[CustomEditor(typeof(Hoge))] | |
public class HogeEditor1 : Editor | |
{ | |
private SerializedProperty intValue1; | |
void OnEnable() | |
{ | |
intValue1 = serializedObject.Find("intValue1"); | |
} | |
public override void OnInspectorGUI() | |
{ | |
EditorGUILayout.PropertyField(intValue1, new GUIContent("intValue1")); | |
} | |
} | |
[CustomEditor(typeof(Hoge))] | |
public class HogeEditor2 : Editor | |
{ | |
private SerializedProperty intValue2; | |
void OnEnable() | |
{ | |
intValue2 = serializedObject.Find("intValue2"); | |
} | |
public override void OnInspectorGUI() | |
{ | |
EditorGUILayout.PropertyField(intValue2, new GUIContent("intValue2")); | |
} | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment