private void OnCommitBattleStart(BattlePracticeContext context)
 {
     if (mOnCommitBattleListener != null)
     {
         mOnCommitBattleListener(context);
     }
 }
 public void Initialize(PracticeManager practiceManager)
 {
     mStateManager             = new StateManager <State>(State.NONE);
     base.transform.localScale = Vector3.one;
     mStateManager.OnPop       = OnPopState;
     mStateManager.OnPush      = OnPushState;
     mStateManager.OnResume    = OnResumeState;
     mStateManager.OnSwitch    = OnSwitchState;
     mPracticeManager          = practiceManager;
     mBattlePracticeContext    = new BattlePracticeContext();
 }
 public void Initialize(PracticeManager practiceManager)
 {
     this.mStateManager = new StateManager <UIBattlePracticeManager.State>(UIBattlePracticeManager.State.NONE);
     base.get_transform().set_localScale(Vector3.get_one());
     this.mStateManager.OnPop    = new Action <UIBattlePracticeManager.State>(this.OnPopState);
     this.mStateManager.OnPush   = new Action <UIBattlePracticeManager.State>(this.OnPushState);
     this.mStateManager.OnResume = new Action <UIBattlePracticeManager.State>(this.OnResumeState);
     this.mStateManager.OnSwitch = new Action <UIBattlePracticeManager.State>(this.OnSwitchState);
     this.mPracticeManager       = practiceManager;
     this.mBattlePracticeContext = new BattlePracticeContext();
 }
 private void OnDestroy()
 {
     mStateManager = null;
     UserInterfacePortManager.ReleaseUtils.Release(ref mWidgetThis);
     mPracticeBattleTargetSelect                = null;
     mUIPracticeBattleStartProduction           = null;
     mPracticeBattleConfirm                     = null;
     mCommonDialog_Dialog                       = null;
     mPrefab_UIBattleFormationKindSelectManager = null;
     mPracticeMenu           = null;
     mCamera_CatchTouchEvent = null;
     mPracticeManager        = null;
     mKeyController          = null;
     mOnBackListener         = null;
     mBattlePracticeContext  = null;
     mOnChangedStateListener = null;
     mOnCommitBattleListener = null;
 }
        private IEnumerator OnCommitBattleStartCoroutine(BattlePracticeContext context)
        {
            yield return(new WaitForEndOfFrame());

            if (context.BattleStartType == BattlePracticeContext.PlayType.Battle)
            {
                mPracticeHeader.UpdateHeaderText(string.Empty);
                RetentionData.SetData(new Hashtable
                {
                    {
                        "rootType",
                        Generics.BattleRootType.Practice
                    },
                    {
                        "areaId",
                        SingletonMonoBehaviour <AppInformation> .Instance.CurrentAreaID
                    },
                    {
                        "practiceManager",
                        mPracticeManager
                    },
                    {
                        "formation",
                        context.FormationType
                    },
                    {
                        "deckID",
                        context.TargetDeck.Id
                    }
                });
                yield return(new WaitForEndOfFrame());

                GameObject prefab = Resources.Load("Prefabs/SortieMap/SortieTransitionToBattle/ProdSortieTransitionToBattle") as GameObject;
                ProdSortieTransitionToBattle smokeProduction = ProdSortieTransitionToBattle.Instantiate(prefab.GetComponent <ProdSortieTransitionToBattle>(), base.transform);
                yield return(new WaitForEndOfFrame());

                bool animationFinished = false;
                smokeProduction.Play(delegate
                {
                    animationFinished = true;
                });
                while (!animationFinished)
                {
                    yield return(new WaitForEndOfFrame());
                }
                if (SingletonMonoBehaviour <PortObjectManager> .exist())
                {
                    SingletonMonoBehaviour <PortObjectManager> .Instance.ManualRelease();

                    UnityEngine.Object.Destroy(SingletonMonoBehaviour <PortObjectManager> .Instance.gameObject);
                    SingletonMonoBehaviour <PortObjectManager> .Instance = null;
                }
                yield return(new WaitForEndOfFrame());

                SingletonMonoBehaviour <AppInformation> .Instance.NextLoadType  = AppInformation.LoadType.White;
                SingletonMonoBehaviour <AppInformation> .Instance.NextLoadScene = Generics.Scene.Battle;
                Application.LoadLevel("LoadingScene");
            }
            else
            {
                mPracticeHeader.UpdateHeaderText(string.Empty);
                PracticeManager  practiceManager = new PracticeManager(context.FriendDeck.Id);
                BattleCutManager bcm             = BattleCutManager.Instantiate(mPrefab_BattleCutManager, new Vector3(20f, 0f));
                yield return(new WaitForEndOfFrame());

                bcm.StartBattleCut(practiceManager, context.TargetDeck.Id, context.FormationType, delegate
                {
                    SingletonMonoBehaviour <PortObjectManager> .Instance.SceneLoad(Generics.Scene.Strategy);
                });
            }
        }
 private void OnCommitBattleStart(BattlePracticeContext context)
 {
     StartCoroutine(OnCommitBattleStartCoroutine(context));
 }