Example #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()
    {
        LevelConfigurationWindow levelConfigurationWindow = GetWindow <LevelConfigurationWindow>("Level Configuration", true);

        levelConfigurationWindow.minSize = new Vector2(400f, 300f);
    }