Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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