Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEditor;
- [CustomEditor(typeof(Game))]
- public class GameEditor : Editor
- {
- public override void OnInspectorGUI()
- {
- Game game = (Game)target;
- EditorGUILayout.PropertyField(serializedObject.FindProperty("gameMode"), new GUIContent("Game Mode"));
- if (game.gameMode == Game.GameMode.CustomStart)
- {
- EditorGUILayout.PropertyField(serializedObject.FindProperty("playerWhitePositions"), true);
- EditorGUILayout.PropertyField(serializedObject.FindProperty("playerBlackPositions"), true);
- }
- // Draw the rest of the fields
- DrawPropertiesExcluding(serializedObject, "gameMode", "playerWhitePositions", "playerBlackPositions");
- serializedObject.ApplyModifiedProperties();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement