Skip to content

Instantly share code, notes, and snippets.

@KRNKRS
Last active June 13, 2017 03:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KRNKRS/7c9137ea2cfc234a9b6f821dc059b9b8 to your computer and use it in GitHub Desktop.
Save KRNKRS/7c9137ea2cfc234a9b6f821dc059b9b8 to your computer and use it in GitHub Desktop.
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