Exemple #1
0
        private IEnumerator Start()
        {
            Stopwatch stopWatch = new Stopwatch();

            stopWatch.Reset();
            stopWatch.Start();
            yield return(new WaitForEndOfFrame());

            mDutyManager = new DutyManager();
            SingletonMonoBehaviour <UIPortFrame> .Instance.CircleUpdateInfo(mDutyManager);

            mDutyGrid.SetOnSummarySelectedCallBack(UIDutySummaryEventCallBack);
            mDutyGrid.SetOnChangePageListener(OnChangePageDutyGrid);
            DutyModel[] duties = GetDuties();
            mDutyGrid.Initialize(duties);
            SoundFile.LoadBGM(BGMFileInfos.PortTools);
            _DeteilMode = false;
            if (duties.Length <= 0)
            {
                mDutyGrid.GoToPage(0, focus: false);
                mTransform_AllClearText.SetActive(isActive: true);
                UpdateOrderPossibleDutyCount(0, animate: false);
                KeyControl nextKeyController = mDutyGrid.GetKeyController();
                mDutyGrid.FirstFocus();
                ChangeKeyController(nextKeyController);
                stopWatch.Stop();
            }
            else
            {
                int orderDutyCount = mDutyManager.MaxExecuteCount - mDutyManager.GetExecutedDutyList().Count;
                UpdateOrderPossibleDutyCount(orderDutyCount, animate: false);
                KeyControl greetingOhyodoKeyController = new KeyControl();
                ChangeKeyController(greetingOhyodoKeyController);
                mDutyGrid.GoToPage(0, focus: false);
                stopWatch.Stop();
                for (int frame = 0; frame < stopWatch.Elapsed.Milliseconds / 60; frame++)
                {
                    yield return(new WaitForEndOfFrame());
                }
                yield return(new WaitForEndOfFrame());

                StartCoroutine(GreetingOhyodo(greetingOhyodoKeyController, delegate
                {
                    KeyControl keyController = this.mDutyGrid.GetKeyController();
                    this.ChangeKeyController(keyController);
                }));
                mDutyGrid.FirstFocus();
            }
            SingletonMonoBehaviour <PortObjectManager> .Instance.PortTransition.EndTransition(delegate
            {
                var preloadBGM = SoundFile.LoadBGM(BGMFileInfos.PortTools);
                SoundUtils.SwitchBGM(preloadBGM);
            });
        }
Exemple #2
0
        private KeyControl ShowUIDutyDetail(UIDutySummary summary)
        {
            SingletonMonoBehaviour <UIShortCutMenu> .Instance.IsInputEnable = true;
            UIDutyDetail dutyDetail = null;

            _DeteilMode = true;
            dutyDetail  = Util.Instantiate(mPrefabDutyDetail.gameObject, mModalCamera.gameObject).GetComponent <UIDutyDetail>();
            dutyDetail.Initialize(summary.GetModel());
            dutyDetail.SetDutyDetailCallBack(delegate(UIDutyDetail.SelectType selectedType)
            {
                if (selectedType == UIDutyDetail.SelectType.Positive)
                {
                    mDutyManager.StartDuty(summary.GetModel().No);
                    UpdateOrderPossibleDutyCount(mDutyManager.MaxExecuteCount - mDutyManager.GetExecutedDutyList().Count, animate: true);
                    DutyModel duty = mDutyManager.GetDuty(summary.GetModel().No);
                    summary.Initialize(summary.GetIndex(), duty);
                    TutorialModel tutorial = mDutyManager.UserInfo.Tutorial;
                    if (tutorial.GetStep() == 0 && !tutorial.GetStepTutorialFlg(1))
                    {
                        tutorial.SetStepTutorialFlg(1);
                        CommonPopupDialog.Instance.StartPopup("「はじめての任務!」 達成");
                        SoundUtils.PlaySE(SEFIleInfos.SE_012);
                    }
                }
                dutyDetail.Hide(delegate
                {
                    _DeteilMode = false;
                    SingletonMonoBehaviour <UIShortCutMenu> .Instance.IsInputEnable = true;
                    KeyControl keyController = mDutyGrid.GetKeyController();
                    UnityEngine.Object.Destroy(dutyDetail.gameObject);
                    mModalCamera.Close();
                    ChangeKeyController(keyController);
                });
            });
            return(dutyDetail.Show());
        }