コード例 #1
0
        public override void OnInspectorGUI()
        {
            SerializedObject so = new SerializedObject(target);

            so.Update();

            SerializedProperty startPoints = so.FindProperty("startPoints");
            SerializedProperty drawGizmos  = so.FindProperty("drawGizmos");

            EditorGUILayout.PropertyField(startPoints);
            EditorGUI.indentLevel++;
            if (startPoints.isExpanded)
            {
                EditorButtons.ShowAddButton(startPoints);

                for (int i = 0; i < startPoints.arraySize; i++)
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.PropertyField(startPoints.GetArrayElementAtIndex(i), new GUIContent("Start point " + (i + 1)));
                    if (EditorButtons.ShowElementButtons(startPoints, i))
                    {
                        continue;
                    }
                    EditorGUILayout.EndHorizontal();
                }
            }
            EditorGUI.indentLevel--;

            EditorGUILayout.PropertyField(drawGizmos);

            so.ApplyModifiedProperties();
        }
コード例 #2
0
ファイル: ListOfBoxesEditor.cs プロジェクト: Smehi/WaveOne
        public override void OnInspectorGUI()
        {
            SerializedObject so = new SerializedObject(target);

            so.Update();

            SerializedProperty startPoints = so.FindProperty("startPoints");
            SerializedProperty setOneAxisToMinimumtPoints = so.FindProperty("setOneAxisToMinimum");
            SerializedProperty drawGizmos = so.FindProperty("drawGizmos");

            EditorGUILayout.PropertyField(startPoints);
            EditorGUI.indentLevel++;
            if (startPoints.isExpanded)
            {
                EditorButtons.ShowAddButton(startPoints);

                for (int i = 0; i < startPoints.arraySize; i++)
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.PropertyField(startPoints.GetArrayElementAtIndex(i), new GUIContent("Start point " + (i + 1)));
                    if (EditorButtons.ShowElementButtons(startPoints, i))
                    {
                        continue;
                    }
                    EditorGUILayout.EndHorizontal();

                    SerializedProperty transform             = startPoints.GetArrayElementAtIndex(i).FindPropertyRelative("transform");
                    SerializedProperty size                  = startPoints.GetArrayElementAtIndex(i).FindPropertyRelative("size");
                    SerializedProperty minDistanceFromCenter = startPoints.GetArrayElementAtIndex(i).FindPropertyRelative("minDistanceFromCenter");

                    EditorGUI.indentLevel++;
                    if (startPoints.GetArrayElementAtIndex(i).isExpanded)
                    {
                        EditorGUILayout.PropertyField(transform);
                        EditorGUILayout.PropertyField(size);
                        EditorGUILayout.PropertyField(minDistanceFromCenter);
                    }
                    EditorGUI.indentLevel--;
                }
            }
            EditorGUI.indentLevel--;

            EditorGUILayout.PropertyField(setOneAxisToMinimumtPoints);
            EditorGUILayout.PropertyField(drawGizmos);

            so.ApplyModifiedProperties();
        }
コード例 #3
0
ファイル: WaveManagerEditor.cs プロジェクト: Smehi/WaveOne
        public override void OnInspectorGUI()
        {
            SerializedObject so = new SerializedObject(target);

            so.Update();

            SerializedProperty autoFindConfigs   = so.FindProperty("autoFindConfigs");
            SerializedProperty showListControls  = so.FindProperty("showListControls");
            SerializedProperty waveConfigurators = so.FindProperty("waveConfigurators");

            EditorGUILayout.PropertyField(autoFindConfigs);

            if (!autoFindConfigs.boolValue)
            {
                EditorGUILayout.PropertyField(showListControls);

                EditorGUILayout.PropertyField(waveConfigurators);
                EditorGUI.indentLevel++;
                if (waveConfigurators.isExpanded)
                {
                    EditorButtons.ShowAddButton(waveConfigurators);

                    for (int i = 0; i < waveConfigurators.arraySize; i++)
                    {
                        EditorGUILayout.BeginHorizontal();
                        EditorGUILayout.PropertyField(waveConfigurators.GetArrayElementAtIndex(i), new GUIContent("Wave config " + (i + 1)));
                        if (showListControls.boolValue && EditorButtons.ShowElementButtons(waveConfigurators, i))
                        {
                            continue;
                        }
                        EditorGUILayout.EndHorizontal();
                    }
                }
                EditorGUI.indentLevel--;
            }

            so.ApplyModifiedProperties();
        }
コード例 #4
0
ファイル: PerWaveCustomEditor.cs プロジェクト: Smehi/WaveOne
        public override void OnInspectorGUI()
        {
            SerializedObject so = new SerializedObject(target);

            so.Update();

            SerializedProperty showWaveListControls    = so.FindProperty("showWaveListControls");
            SerializedProperty showEnemiesListControls = so.FindProperty("showEnemiesListControls");
            SerializedProperty enemyWaves = so.FindProperty("enemyWaves");
            SerializedProperty minTimeForNextDeployment = so.FindProperty("minTimeForNextDeployment");
            SerializedProperty maxTimeForNextDeployment = so.FindProperty("maxTimeForNextDeployment");
            SerializedProperty spawnRate            = so.FindProperty("spawnRate");
            SerializedProperty autoDeploy           = so.FindProperty("autoDeploy");
            SerializedProperty enemyParentObject    = so.FindProperty("enemyParentObject");
            SerializedProperty eventSpawnerFinished = so.FindProperty("eventSpawnerFinished");
            SerializedProperty eventTotalEnemies    = so.FindProperty("eventTotalEnemies");
            SerializedProperty eventDeployedEnemies = so.FindProperty("eventDeployedEnemies");
            SerializedProperty eventAliveEnemies    = so.FindProperty("eventAliveEnemies");

            EditorGUILayout.PropertyField(showWaveListControls);
            EditorGUILayout.PropertyField(showEnemiesListControls);

            // List<SingleWave>
            EditorGUILayout.PropertyField(enemyWaves);
            EditorGUI.indentLevel++;
            if (enemyWaves.isExpanded)
            {
                EditorButtons.ShowAddButton(enemyWaves);

                for (int i = 0; i < enemyWaves.arraySize; i++)
                {
                    // List<SingleWave> list element
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.PropertyField(enemyWaves.GetArrayElementAtIndex(i));
                    if (showWaveListControls.boolValue && EditorButtons.ShowElementButtons(enemyWaves, i))
                    {
                        continue;
                    }
                    EditorGUILayout.EndHorizontal();

                    SerializedProperty enemies     = enemyWaves.GetArrayElementAtIndex(i).FindPropertyRelative("enemies");
                    SerializedProperty deployments = enemyWaves.GetArrayElementAtIndex(i).FindPropertyRelative("deployments");

                    // SingleWave List<EnemyCount>
                    EditorGUI.indentLevel++;
                    if (enemyWaves.GetArrayElementAtIndex(i).isExpanded)
                    {
                        EditorGUILayout.PropertyField(enemies);

                        EditorGUI.indentLevel++;
                        if (enemies.isExpanded)
                        {
                            EditorButtons.ShowAddButton(enemies);

                            for (int j = 0; j < enemies.arraySize; j++)
                            {
                                // SingleWave List<EnemyCount> list element
                                EditorGUILayout.BeginHorizontal();
                                EditorGUILayout.PropertyField(enemies.GetArrayElementAtIndex(j));
                                if (showEnemiesListControls.boolValue && EditorButtons.ShowElementButtons(enemies, j))
                                {
                                    continue;
                                }
                                EditorGUILayout.EndHorizontal();

                                SerializedProperty gameObject = enemies.GetArrayElementAtIndex(j).FindPropertyRelative("gameObject");
                                SerializedProperty amount     = enemies.GetArrayElementAtIndex(j).FindPropertyRelative("amount");
                                SerializedProperty groupSize  = enemies.GetArrayElementAtIndex(j).FindPropertyRelative("groupSize");

                                // EnemyCount values
                                EditorGUI.indentLevel++;
                                if (enemies.GetArrayElementAtIndex(j).isExpanded)
                                {
                                    EditorGUILayout.PropertyField(gameObject);
                                    EditorGUILayout.PropertyField(amount);
                                    EditorGUILayout.PropertyField(groupSize);
                                }
                                EditorGUI.indentLevel--;
                            }
                        }
                        EditorGUI.indentLevel--;

                        // SingleWave deployments
                        EditorGUILayout.PropertyField(deployments);
                    }
                    EditorGUI.indentLevel--;
                }
            }
            EditorGUI.indentLevel--;

            EditorGUILayout.Space();
            EditorGUILayout.PropertyField(minTimeForNextDeployment, true);
            EditorGUILayout.PropertyField(maxTimeForNextDeployment, true);
            EditorGUILayout.PropertyField(spawnRate, true);
            EditorGUILayout.PropertyField(autoDeploy, true);
            EditorGUILayout.PropertyField(enemyParentObject, true);
            EditorGUILayout.PropertyField(eventSpawnerFinished, true);
            EditorGUILayout.PropertyField(eventTotalEnemies, true);
            EditorGUILayout.PropertyField(eventDeployedEnemies, true);
            EditorGUILayout.PropertyField(eventAliveEnemies, true);

            so.ApplyModifiedProperties();
        }
コード例 #5
0
        public override void OnInspectorGUI()
        {
            SerializedObject so = new SerializedObject(target);

            so.Update();

            SerializedProperty showEnemiesListControls = so.FindProperty("showEnemiesListControls");
            SerializedProperty enemyList            = so.FindProperty("enemyList");
            SerializedProperty maxTime              = so.FindProperty("maxTime");
            SerializedProperty spawnRate            = so.FindProperty("spawnRate");
            SerializedProperty enemyParentObject    = so.FindProperty("enemyParentObject");
            SerializedProperty eventSpawnerFinished = so.FindProperty("eventSpawnerFinished");
            SerializedProperty eventDeployedEnemies = so.FindProperty("eventDeployedEnemies");
            SerializedProperty eventAliveEnemies    = so.FindProperty("eventAliveEnemies");

            EditorGUILayout.PropertyField(showEnemiesListControls, true);

            // List<EnemyWithWeight>
            EditorGUILayout.PropertyField(enemyList);
            EditorGUI.indentLevel++;
            if (enemyList.isExpanded)
            {
                EditorButtons.ShowAddButton(enemyList);

                for (int i = 0; i < enemyList.arraySize; i++)
                {
                    // List<EnemyWithWeight> list element
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.PropertyField(enemyList.GetArrayElementAtIndex(i));
                    if (showEnemiesListControls.boolValue && EditorButtons.ShowElementButtons(enemyList, i))
                    {
                        continue;
                    }
                    EditorGUILayout.EndHorizontal();

                    SerializedProperty enemies   = enemyList.GetArrayElementAtIndex(i).FindPropertyRelative("gameObject");
                    SerializedProperty groupSize = enemyList.GetArrayElementAtIndex(i).FindPropertyRelative("groupSize");
                    SerializedProperty weight    = enemyList.GetArrayElementAtIndex(i).FindPropertyRelative("weight");

                    // EnemyWithWeight elements
                    EditorGUI.indentLevel++;
                    if (enemyList.GetArrayElementAtIndex(i).isExpanded)
                    {
                        EditorGUILayout.PropertyField(enemies);
                        EditorGUILayout.PropertyField(groupSize);
                        EditorGUILayout.PropertyField(weight);
                    }
                    EditorGUI.indentLevel--;
                }
            }
            EditorGUI.indentLevel--;

            EditorGUILayout.Space();
            EditorGUILayout.PropertyField(maxTime);
            EditorGUILayout.PropertyField(spawnRate);
            EditorGUILayout.PropertyField(enemyParentObject);
            EditorGUILayout.PropertyField(eventSpawnerFinished);
            EditorGUILayout.PropertyField(eventDeployedEnemies);
            EditorGUILayout.PropertyField(eventAliveEnemies);

            so.ApplyModifiedProperties();
        }
コード例 #6
0
ファイル: EndPointEditor.cs プロジェクト: Smehi/WaveOne
        public override void OnInspectorGUI()
        {
            SerializedObject so = new SerializedObject(target);

            so.Update();

            SerializedProperty showEndPointsListControls         = so.FindProperty("showEndPointsListControls");
            SerializedProperty showEnemiesListControls           = so.FindProperty("showEnemiesListControls");
            SerializedProperty showNoEndPointEnemiesListControls = so.FindProperty("showNoEndPointEnemiesListControls");
            SerializedProperty endPoints         = so.FindProperty("endPoints");
            SerializedProperty addColliders      = so.FindProperty("addColliders");
            SerializedProperty triggerColliders  = so.FindProperty("triggerColliders");
            SerializedProperty colliderSize      = so.FindProperty("colliderSize");
            SerializedProperty noEndPointEnemies = so.FindProperty("noEndPointEnemies");

            EditorGUILayout.PropertyField(showEndPointsListControls);
            EditorGUILayout.PropertyField(showEnemiesListControls);
            EditorGUILayout.PropertyField(showNoEndPointEnemiesListControls);

            // List<EndPoint>
            EditorGUILayout.PropertyField(endPoints);
            EditorGUI.indentLevel++;
            if (endPoints.isExpanded)
            {
                EditorButtons.ShowAddButton(endPoints);

                for (int i = 0; i < endPoints.arraySize; i++)
                {
                    // List<EndPoint> list element
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.PropertyField(endPoints.GetArrayElementAtIndex(i));
                    if (showEndPointsListControls.boolValue && EditorButtons.ShowElementButtons(endPoints, i))
                    {
                        continue;
                    }
                    EditorGUILayout.EndHorizontal();

                    SerializedProperty endPoint = endPoints.GetArrayElementAtIndex(i).FindPropertyRelative("endPoint");
                    SerializedProperty enemies  = endPoints.GetArrayElementAtIndex(i).FindPropertyRelative("enemies");

                    EditorGUI.indentLevel++;
                    if (endPoints.GetArrayElementAtIndex(i).isExpanded)
                    {
                        EditorGUILayout.PropertyField(endPoint);
                        // EndPoint List<GameObject>
                        EditorGUILayout.PropertyField(enemies);

                        EditorGUI.indentLevel++;
                        if (enemies.isExpanded)
                        {
                            EditorButtons.ShowAddButton(enemies);

                            for (int j = 0; j < enemies.arraySize; j++)
                            {
                                // EndPoint List<GameObject> list element
                                EditorGUILayout.BeginHorizontal();
                                EditorGUILayout.PropertyField(enemies.GetArrayElementAtIndex(j), new GUIContent("Enemy " + (j + 1)));
                                if (showEnemiesListControls.boolValue && EditorButtons.ShowElementButtons(enemies, j))
                                {
                                    continue;
                                }
                                EditorGUILayout.EndHorizontal();
                            }
                        }
                        EditorGUI.indentLevel--;
                    }
                    EditorGUI.indentLevel--;
                }
            }
            EditorGUI.indentLevel--;

            EditorGUILayout.PropertyField(addColliders, true);

            using (var group = new EditorGUILayout.FadeGroupScope(System.Convert.ToSingle(addColliders.boolValue)))
            {
                if (group.visible)
                {
                    EditorGUILayout.PropertyField(triggerColliders, true);
                    EditorGUILayout.PropertyField(colliderSize, true);
                }
            }

            EditorGUILayout.PropertyField(noEndPointEnemies);
            EditorGUI.indentLevel++;
            if (noEndPointEnemies.isExpanded)
            {
                EditorButtons.ShowAddButton(noEndPointEnemies);

                for (int i = 0; i < noEndPointEnemies.arraySize; i++)
                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.PropertyField(noEndPointEnemies.GetArrayElementAtIndex(i), new GUIContent("Enemy " + (i + 1)));
                    if (showNoEndPointEnemiesListControls.boolValue && EditorButtons.ShowElementButtons(noEndPointEnemies, i))
                    {
                        continue;
                    }
                    EditorGUILayout.EndHorizontal();
                }
            }
            EditorGUI.indentLevel--;

            so.ApplyModifiedProperties();
        }