Exemplo n.º 1
0
 public void OnFormClosed()
 {
     this.UnregisterEvents();
     this.m_battleFloatDigitManager.ClearAllBattleFloatText();
     this.m_battleEquipSystem.Clear();
     if (this._miniMapSys != null)
     {
         this._miniMapSys.Clear();
         this._miniMapSys = null;
     }
     if (this._killNotify != null)
     {
         this._killNotify.Clear();
         this._killNotify = null;
     }
     if (this.m_towerHitMgr != null)
     {
         this.m_towerHitMgr.Clear();
         this.m_towerHitMgr = null;
     }
     if (this._battleStatView != null)
     {
         this._battleStatView.Clear();
         this._battleStatView = null;
     }
     this._battleForm = null;
 }
Exemplo n.º 2
0
        public void OpenForm(FormType formType)
        {
            this.m_MaxBattleFPS   = 0f;
            this.m_MinBattleFPS   = float.MaxValue;
            this.m_AveBattleFPS   = 0f;
            this.m_BattleFPSCount = 0f;
            this.m_frameCount     = 0;
            if (formType == FormType.Fight)
            {
                this._battleForm = new Assets.Scripts.GameSystem.FightForm();
            }
            else if (formType == FormType.Watch)
            {
                this._battleForm = new Assets.Scripts.GameSystem.WatchForm();
            }
            if ((this._battleForm == null) || !this._battleForm.OpenForm())
            {
                this._battleForm = null;
            }
            else
            {
                Player hostPlayer = Singleton <GamePlayerCenter> .instance.GetHostPlayer();

                SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

                this.m_battleEquipSystem.Initialize(this.FightFormScript, hostPlayer.Captain, curLvelContext.IsMobaMode(), curLvelContext.m_isBattleEquipLimit);
                this._miniMapSys = new MinimapSys();
                this._miniMapSys.Init(this.FormScript, curLvelContext);
                this._killNotify = new KillNotify();
                this._killNotify.Init(this.FormScript);
                this._killNotify.Hide();
                this.m_towerHitMgr = new Assets.Scripts.GameSystem.TowerHitMgr();
                this.m_towerHitMgr.Init();
                if (curLvelContext.IsMobaMode())
                {
                    this._battleStatView = new Assets.Scripts.GameSystem.BattleStatView();
                    this._battleStatView.Init();
                }
                this.RegisterEvents();
            }
        }