Пример #1
0
        private void OnBuildingAttacked(ref DefaultGameEventParam evtParam)
        {
            if (evtParam.src != 0)
            {
                ActorRoot handle = evtParam.src.handle;
                if ((handle != null) && HudUT.IsTower(handle))
                {
                    HudComponent3D hudControl = handle.HudControl;
                    if (hudControl != null)
                    {
                        GameObject  target      = hudControl.GetCurrent_MapObj();
                        TowerHitMgr towerHitMgr = Singleton <CBattleSystem> .GetInstance().TowerHitMgr;

                        if ((target != null) && (towerHitMgr != null))
                        {
                            towerHitMgr.TryActive(handle.ObjID, target);
                        }
                        Image image  = hudControl.GetBigTower_Img();
                        Image image2 = hudControl.GetSmallTower_Img();
                        if (((image != null) && (image2 != null)) && (handle.ValueComponent != null))
                        {
                            float single = handle.ValueComponent.GetHpRate().single;
                            image.fillAmount  = single;
                            image2.fillAmount = single;
                        }
                    }
                }
            }
        }
Пример #2
0
        public void OpenForm(CBattleSystem.FormType formType)
        {
            this.m_MaxBattleFPS   = 0f;
            this.m_MinBattleFPS   = 3.40282347E+38f;
            this.m_AveBattleFPS   = 0f;
            this.m_BattleFPSCount = 0f;
            this.m_frameCount     = 0;
            if (formType == CBattleSystem.FormType.Fight)
            {
                this._battle3DTouch = new InBattle3DTouch();
                this._battle3DTouch.Init();
                this._battleForm = new FightForm();
            }
            else if (formType == CBattleSystem.FormType.Watch)
            {
                this._battleForm = new WatchForm();
            }
            if (this._battleForm == null || !this._battleForm.OpenForm())
            {
                this._battleForm = null;
                return;
            }
            Player hostPlayer = Singleton <GamePlayerCenter> .get_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._killNotify.Hide();
            this.m_towerHitMgr = new TowerHitMgr();
            this.m_towerHitMgr.Init();
            if (curLvelContext.IsMobaMode())
            {
                this._battleStatView = new BattleStatView();
                this._battleStatView.Init();
            }
            this.pauseControl = new PauseControl(this.FormScript);
            this.RegisterEvents();
        }
Пример #3
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;
     }
     if (this.pauseControl != null)
     {
         this.pauseControl.Clear();
         this.pauseControl = null;
     }
     if (this._battle3DTouch != null)
     {
         this._battle3DTouch.Clear();
         this._battle3DTouch = null;
     }
     this._battleForm = null;
 }