public void Unload()
 {
     if (!ConfigWindow.IsConfig)
     {
         return;
     }
     this.Save();
     if (ConfigWindow.UnLoadAction != null)
     {
         ConfigWindow.UnLoadAction();
     }
     Object.Destroy((Object)((Component)this).get_gameObject());
 }
        public void OnTitle()
        {
            this.PlaySE(SoundPack.SystemSE.OK_S);
            bool flag = false;

            if (Singleton <Manager.Scene> .Instance.NowSceneNames[0] == "Title")
            {
                flag = true;
            }
            if (!flag)
            {
                ConfirmScene.Sentence     = this.localizeIsTitle[Singleton <GameSystem> .Instance.languageInt];
                ConfirmScene.OnClickedYes = (Action)(() =>
                {
                    this.Save();
                    if (ConfigWindow.TitleChangeAction != null)
                    {
                        ConfigWindow.TitleChangeAction();
                    }
                    if (ConfigWindow.UnLoadAction != null)
                    {
                        ConfigWindow.UnLoadAction();
                    }
                    Singleton <Game> .Instance.Dialog.TimeScale = 1f;
                    this.PlaySE(SoundPack.SystemSE.OK_L);
                    Singleton <Manager.Scene> .Instance.LoadReserve(new Manager.Scene.Data()
                    {
                        levelName = "Title",
                        isFade = true,
                        onLoad = (Action)(() =>
                        {
                            if (!ConfigWindow.IsConfig)
                            {
                                return;
                            }
                            Object.Destroy((Object)((Component)this).get_gameObject());
                            Singleton <Game> .Instance.WorldData = (WorldData)null;
                        })
                    }, true);
                });
                ConfirmScene.OnClickedNo = (Action)(() => this.PlaySE(SoundPack.SystemSE.Cancel));
                Singleton <Game> .Instance.LoadDialog();
            }
            else
            {
                this.Close((Action)(() => this.Unload()));
            }
        }