public static ToggleOption CreateSubmenuOption(GameplaySettingsPanels panel, string optionName, string submenuName, string submenuToEnter, string hintText = "", Sprite optionIcon = null)
        {
            lock (Instance[panel])
            {
                SubmenuOption ret = new SubmenuOption(panel, optionName, hintText, optionIcon);
                if (!Instance[panel]._customMenus.ContainsKey(submenuName))
                {
                    Instance[panel]._customMenus[submenuName] = new List <GameOption>();
                }

                ret.OnToggle += (e) => GameplaySettingsUI.EnterSubmenu(panel, submenuToEnter);

                Instance[panel]._customMenus[submenuName].Add(ret);
                return(ret);
            }
        }
 private void SceneManager_activeSceneChanged(Scene from, Scene to)
 {
     if (to.name == "EmptyTransition")
     {
         if (Instance)
         {
             Destroy(Instance.gameObject);
         }
         initialized = false;
         Instance    = null;
     }
     else
     {
         Build();
     }
 }