예제 #1
0
    private void OnGUI()
    {
        int numberOfItems = 0;

        foreach (GameModeProperties gameModeProperties in Resources.LoadAll("Data/Game Mode Properties/"))
        {
            numberOfItems++;
        }
        scenesEnabled = numberOfItems > 0;
        EditorGUILayout.Space();
        GUIStyle bannerStyle = new GUIStyle
        {
            alignment = TextAnchor.MiddleCenter,
            fontSize  = 15,
            fontStyle = FontStyle.Bold
        };

        EditorGUILayout.LabelField("Game Generator", bannerStyle);
        EditorGUILayout.Space();
        EditorGUILayout.Space();
        if (GUILayout.Button("Game Mode configuration"))
        {
            GameModeGeneratorWindow.OpenWindow();
        }
        EditorGUI.BeginDisabledGroup(!scenesEnabled);
        if (GUILayout.Button("Scene generator"))
        {
            SceneGeneratorWindow.OpenWindow();
        }
        if (GUILayout.Button("Player configuration"))
        {
            PlayerGeneratorWindow.OpenWindow();
        }
        if (GUILayout.Button("Level configuration"))
        {
            LevelConfigurationWindow.OpenWindow();
        }
        EditorGUI.EndDisabledGroup();
    }
 public static void OpenWindow()
 {
     sceneGeneratorWindow         = GetWindow <SceneGeneratorWindow>("Scene Generator", true);
     sceneGeneratorWindow.minSize = new Vector2(200f, 170f);
     sceneGeneratorWindow.maxSize = new Vector2(300f, 350f);
 }