示例#1
0
        public override void ModuleWindow(int id)
        {
            if (this.ValidPanels.Count == 0)
            {
                GUILayout.BeginHorizontal();

                GUILayout.Label("No valid scripted panels for this scene and game type.");

                GUILayout.EndHorizontal();

                base.ModuleWindow(id);

                return;
            }

            foreach (var panel in this.ValidPanels)
            {
                panel.Active = Layout.Toggle(panel.Active, panel.Name);
            }

            if (GUILayout.Button("Reload Panel Configs"))
            {
                VOID_ScriptedPanel.LoadScriptedPanels();

                this.core.onUpdate += onUpdateHandler;
            }

            base.ModuleWindow(id);
        }
示例#2
0
        public VOID_ScriptedManager() : base()
        {
            this.Name = "Scripted Panel Manager";

            this.validPanels = new List <VOID_ScriptedPanel>();

            VOID_ScriptedPanel.LoadScriptedPanels();

            GameEvents.onGameStateLoad.Add(this.refreshValidPanels);
            GameEvents.onGameSceneLoadRequested.Add(this.refreshValidPanels);

            this.core.onUpdate += onUpdateHandler;
        }