Exemple #1
0
        private void OnGUI()
        {
            if (!showGui)
            {
                return;
            }

            GUIDune.LoadSkin(GetControlModule <DuneSettingsWindow>().skinType);

            GUI.skin = GUIDune.skin;


            foreach (DisplayModule module in GetControlModules <DisplayModule>())
            {
                try
                {
                    if (module.enabled)
                    {
                        module.DrawGUI();
                    }
                }
                catch (Exception e)
                {
                    Debug.LogError("[Dune] Core OnGUI() module " + module.GetName() + " Exception: " + e);
                }
            }
        }
Exemple #2
0
        protected override void WindowGUI(int windowId)
        {
            GUILayout.BeginVertical();

            GUIDune.Title("Skins");
            GUIDune.Label("Current skin: ", skinType.ToString());

            if (GUIDune.skin == null || skinType != GUIDune.SkinType.Dune)
            {
                if (GUILayout.Button("Use Dune GUI skin"))
                {
                    GUIDune.LoadSkin(GUIDune.SkinType.Dune);
                    skinType = GUIDune.SkinType.Dune;
                }
            }

            if (GUIDune.skin == null || skinType != GUIDune.SkinType.Default)
            {
                if (GUILayout.Button("Use default GUI skin"))
                {
                    GUIDune.LoadSkin(GUIDune.SkinType.Default);
                    skinType = GUIDune.SkinType.Default;
                }
            }

            GUILayout.BeginHorizontal();
            GUILayout.Label("Reset all settings to default: ", GUILayout.ExpandWidth(true));
            if (GUILayout.Button("Reset"))
            {
                core.GetControlModule <SettingsDialog>().enabled        = true;
                core.GetControlModule <SettingsDialog>().windowIsHidden = false;
            }
            GUILayout.EndHorizontal();

            GUILayout.EndVertical();

            base.WindowGUI(windowId);
        }