예제 #1
0
    void Init()
    {
        Chapters.Clear();
        Yes.onClick.AddListener(() =>
        {
            OnEnterChapter();
        });

        Cancel.onClick.AddListener(() =>
        {
            Main.Ins.DialogStateManager.ChangeState(Main.Ins.DialogStateManager.MainMenuState);
        });

        if (GameStateMgr.Ins.gameStatus.pluginChapter != null)
        {
            int insertCount = 0;
            for (int i = 0; i < GameStateMgr.Ins.gameStatus.pluginChapter.Count; i++)
            {
                Chapter lev = GameStateMgr.Ins.gameStatus.pluginChapter[i];
                if (lev == null)
                {
                    continue;
                }
                lev.Check();
                if (!lev.Installed)
                {
                    continue;
                }
                AddGridItem(lev, rootMenu.transform);
                insertCount++;
                select = lev;
            }

            if (insertCount != 0)
            {
                rootCtrl.Reload(OnSelectChapter);
            }
        }
        if (Chapters.Count != 0)
        {
            PageLabel.text = string.Format("剧本:{0}/{1}", 1, Chapters.Count);
        }
        else
        {
            PageLabel.text = "剧本:未安装任何剧本";
        }
        OnSelectChapter(select);
    }
예제 #2
0
    void Init()
    {
        Yes.onClick.AddListener(() =>
        {
            OnEnterChapter();
        });

        Cancel.onClick.AddListener(() =>
        {
            Main.Ins.DialogStateManager.ChangeState(Main.Ins.DialogStateManager.MainMenuState);
        });

        if (Main.Ins.GameStateMgr.gameStatus.pluginChapter != null)
        {
            int insertCount = 0;
            for (int i = 0; i < Main.Ins.GameStateMgr.gameStatus.pluginChapter.Count; i++)
            {
                Chapter lev = Main.Ins.GameStateMgr.gameStatus.pluginChapter[i];
                if (lev == null)
                {
                    continue;
                }
                lev.Check();
                if (!lev.Installed)
                {
                    continue;
                }
                AddGridItem(lev, rootMenu.transform);
                insertCount++;
                select = lev;
            }

            if (insertCount != 0)
            {
                rootCtrl.Reload(OnSelectChapter);
            }
        }
        OnSelectChapter(select);
    }