private void MainPanel()
    {
        scrollPos = EditorGUILayout.BeginScrollView(scrollPos);

        string selectedMenuItem    = menu.SelectedMenu;
        string selectedSubMenuItem = menu.SelectedSubMenu;

        if (selectedMenuItem == "Auto Save")
        {
#if UNITY_2017_1_OR_NEWER
            EditorGUILayout.LabelField("Easy Save 2 Auto Save was deprected in Unity 2017. Use Easy Save 3 Auto Save instead.");
#else
            if (selectedSubMenuItem == "Scene")
            {
                if (windowContent == null || windowContent.GetType() != typeof(ES2EditorAutoSaveScene))
                {
                    windowContent = new ES2EditorAutoSaveScene();
                }
                windowContent.Draw();
            }

            if (selectedSubMenuItem == "Prefabs")
            {
                if (windowContent == null || windowContent.GetType() != typeof(ES2EditorAutoSavePrefabs))
                {
                    windowContent = new ES2EditorAutoSavePrefabs();
                }
                windowContent.Draw();
            }

            if (selectedSubMenuItem == "Settings")
            {
                if (windowContent == null || windowContent.GetType() != typeof(ES2EditorAutoSaveSettings))
                {
                    windowContent = new ES2EditorAutoSaveSettings();
                }
                windowContent.Draw();
            }
#endif
        }
        else if (selectedMenuItem == "Settings")
        {
            if (selectedSubMenuItem == "General")
            {
                if (windowContent == null || windowContent.GetType() != typeof(ES2EditorSettingsGeneral))
                {
                    windowContent = new ES2EditorSettingsGeneral();
                }
                windowContent.Draw();
            }
            else if (selectedSubMenuItem == "Tools")
            {
                if (windowContent == null || windowContent.GetType() != typeof(ES2EditorSettingsTools))
                {
                    windowContent = new ES2EditorSettingsTools();
                }
                windowContent.Draw();
            }
            else if (selectedSubMenuItem == "Information")
            {
                if (windowContent == null || windowContent.GetType() != typeof(ES2EditorSettingsInformation))
                {
                    windowContent = new ES2EditorSettingsInformation();
                }
                windowContent.Draw();
            }
            else if (selectedSubMenuItem == "Change Log")
            {
                if (windowContent == null || windowContent.GetType() != typeof(ES2EditorSettingsChangeLog))
                {
                    windowContent = new ES2EditorSettingsChangeLog();
                }
                windowContent.Draw();
            }
            else if (selectedSubMenuItem == "Readme")
            {
                if (windowContent == null || windowContent.GetType() != typeof(ES2EditorSettingsReadme))
                {
                    windowContent = new ES2EditorSettingsReadme();
                }
                windowContent.Draw();
            }
        }

        EditorGUILayout.EndScrollView();
    }
Ejemplo n.º 2
0
    private void MainPanel()
    {
        scrollPos = EditorGUILayout.BeginScrollView(scrollPos);

        string selectedMenuItem    = menu.SelectedMenu;
        string selectedSubMenuItem = menu.SelectedSubMenu;

        if (selectedMenuItem == "Auto Save")
        {
            if (selectedSubMenuItem == "Scene")
            {
                if (windowContent == null || windowContent.GetType() != typeof(ES2EditorAutoSaveScene))
                {
                    windowContent = new ES2EditorAutoSaveScene();
                }
                windowContent.Draw();
            }

            if (selectedSubMenuItem == "Prefabs")
            {
                if (windowContent == null || windowContent.GetType() != typeof(ES2EditorAutoSavePrefabs))
                {
                    windowContent = new ES2EditorAutoSavePrefabs();
                }
                windowContent.Draw();
            }

            if (selectedSubMenuItem == "Settings")
            {
                if (windowContent == null || windowContent.GetType() != typeof(ES2EditorAutoSaveSettings))
                {
                    windowContent = new ES2EditorAutoSaveSettings();
                }
                windowContent.Draw();
            }
        }
        else if (selectedMenuItem == "Settings")
        {
            if (selectedSubMenuItem == "General")
            {
                if (windowContent == null || windowContent.GetType() != typeof(ES2EditorSettingsGeneral))
                {
                    windowContent = new ES2EditorSettingsGeneral();
                }
                windowContent.Draw();
            }
            else if (selectedSubMenuItem == "Tools")
            {
                if (windowContent == null || windowContent.GetType() != typeof(ES2EditorSettingsTools))
                {
                    windowContent = new ES2EditorSettingsTools();
                }
                windowContent.Draw();
            }
            else if (selectedSubMenuItem == "Information")
            {
                if (windowContent == null || windowContent.GetType() != typeof(ES2EditorSettingsInformation))
                {
                    windowContent = new ES2EditorSettingsInformation();
                }
                windowContent.Draw();
            }
            else if (selectedSubMenuItem == "Change Log")
            {
                if (windowContent == null || windowContent.GetType() != typeof(ES2EditorSettingsChangeLog))
                {
                    windowContent = new ES2EditorSettingsChangeLog();
                }
                windowContent.Draw();
            }
            else if (selectedSubMenuItem == "Readme")
            {
                if (windowContent == null || windowContent.GetType() != typeof(ES2EditorSettingsReadme))
                {
                    windowContent = new ES2EditorSettingsReadme();
                }
                windowContent.Draw();
            }
        }

        EditorGUILayout.EndScrollView();
    }