public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { EditorGUI.BeginProperty(position, label, property); SerializedProperty inputHandler = property.FindPropertyRelative("inputHandler"); SerializedProperty humanInputType = property.FindPropertyRelative("humanInputType"); Rect fieldRect = position; fieldRect.height = EditorGUIUtility.singleLineHeight; CustomUtilities.DrawEditorHorizontalLine(ref fieldRect, Color.gray); EditorGUI.PropertyField(fieldRect, humanInputType); fieldRect.y += fieldRect.height; switch ((HumanInputType)humanInputType.enumValueIndex) { case HumanInputType.InputManager: break; case HumanInputType.UIMobile: fieldRect.height = 3f * EditorGUIUtility.singleLineHeight; EditorGUI.HelpBox( fieldRect, "This mode will automatically search for buttons and axes from the scene. " + "Make sure these elements \"action names\" match with the character actions you want to trigger.", MessageType.Info ); fieldRect.y += fieldRect.height; break; case HumanInputType.Custom: EditorGUI.PropertyField(fieldRect, inputHandler); fieldRect.y += fieldRect.height; fieldRect.height = 3f * EditorGUIUtility.singleLineHeight; EditorGUI.HelpBox( fieldRect, "Use your own InputHandler component (Monobehaviour).", MessageType.Info ); fieldRect.y += fieldRect.height; break; } fieldRect.height = EditorGUIUtility.singleLineHeight; CustomUtilities.DrawEditorHorizontalLine(ref fieldRect, Color.gray); EditorGUI.EndProperty(); }