Ejemplo n.º 1
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            GUILayout.Space(20);

            if (GUILayout.Button("Place Blocks"))
            {
                this.blockWindow = (GridMapEditorWindow)EditorWindow.GetWindow(typeof(GridMapEditorWindow));
                this.blockWindow.Init();
                this.blockWindow.Show();
            }

            EditorGUILayout.BeginHorizontal();
            if (!this._placeSpawnPoints)
            {
                if (GUILayout.Button("Place Spawn Points"))
                {
                    this._placeSpawnPoints = true;
                    this._humanSapwnSet    = false;
                    this._aiSpawnSet       = false;
                }
            }
            else
            {
                EditorGUILayout.LabelField("Please Select Spawn Points", EditorStyles.boldLabel);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginVertical();
            this._spawnFoldOut = EditorGUILayout.Foldout(this._spawnFoldOut, "Manual Spawn Entry - Use With Caution!");
            if (this._spawnFoldOut)
            {
                EditorGUI.indentLevel++;
                EditorGUILayout.BeginHorizontal();
                this._tempHumanPoint         = EditorGUILayout.Vector2Field("Player Spawn Point:", new Vector2(this._target.humanSpawnPoint.x, this._target.humanSpawnPoint.z));
                this._target.humanSpawnPoint = new Vector3(this._tempHumanPoint.x, this._target.humanSpawnPoint.y, this._tempHumanPoint.y);
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                this._tempAIPoint         = EditorGUILayout.Vector2Field("AI Spawn Point:", new Vector2(this._target.aiSpawnPoint.x, this._target.aiSpawnPoint.z));
                this._target.aiSpawnPoint = new Vector3(this._tempAIPoint.x, this._target.aiSpawnPoint.y, this._tempAIPoint.y);
                EditorGUILayout.EndHorizontal();
                EditorGUI.indentLevel--;
            }
            EditorGUILayout.EndVertical();

            GUILayout.Space(20);

            SceneView.RepaintAll();
            EditorUtility.SetDirty(target);
        }
Ejemplo n.º 2
0
        public override void OnInspectorGUI() {

            base.OnInspectorGUI();

            GUILayout.Space(20);

            if(GUILayout.Button("Place Blocks")) {
                this.blockWindow = (GridMapEditorWindow)EditorWindow.GetWindow(typeof(GridMapEditorWindow));
                this.blockWindow.Init();
                this.blockWindow.Show();
            }

            EditorGUILayout.BeginHorizontal();
            if(!this._placeSpawnPoints) {
                if(GUILayout.Button("Place Spawn Points")) {
                    this._placeSpawnPoints = true;
                    this._humanSapwnSet = false;
                    this._aiSpawnSet = false;
                }
            } else{
                EditorGUILayout.LabelField("Please Select Spawn Points", EditorStyles.boldLabel);
            }
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.BeginVertical();
            this._spawnFoldOut = EditorGUILayout.Foldout(this._spawnFoldOut, "Manual Spawn Entry - Use With Caution!");
                if(this._spawnFoldOut) {
                    EditorGUI.indentLevel++;
                    EditorGUILayout.BeginHorizontal();
                    this._tempHumanPoint = EditorGUILayout.Vector2Field("Player Spawn Point:", new Vector2(this._target.humanSpawnPoint.x, this._target.humanSpawnPoint.z));
                    this._target.humanSpawnPoint = new Vector3(this._tempHumanPoint.x, this._target.humanSpawnPoint.y, this._tempHumanPoint.y);
                    EditorGUILayout.EndHorizontal();

                    EditorGUILayout.BeginHorizontal();
                    this._tempAIPoint = EditorGUILayout.Vector2Field("AI Spawn Point:", new Vector2(this._target.aiSpawnPoint.x, this._target.aiSpawnPoint.z));
                    this._target.aiSpawnPoint = new Vector3(this._tempAIPoint.x, this._target.aiSpawnPoint.y, this._tempAIPoint.y);
                    EditorGUILayout.EndHorizontal();
                    EditorGUI.indentLevel--;
                }
            EditorGUILayout.EndVertical();

            GUILayout.Space(20);

            SceneView.RepaintAll();
            EditorUtility.SetDirty(target);
        }