public override void Init()
        {
            base.Init();
            Transform transform = this.transform.FindChild("ParentNode");

            this.mTweenPos = transform.GetComponent <TweenPosition>();
            this.mTime     = transform.FindChild("Time/TimeLabel").GetComponent <UILabel>();
            this.mTeam1    = transform.FindChild("TeamScore/Team1").GetComponent <UILabel>();
            this.mTeam2    = transform.FindChild("TeamScore/Team2").GetComponent <UILabel>();
            this.mKill     = transform.FindChild("Kill/KillNumLabel").GetComponent <UILabel>();
            this.mDeath    = transform.FindChild("Death/DeathNumLabel").GetComponent <UILabel>();
            this.mAssists  = transform.FindChild("Assists/AssistsNumLabel").GetComponent <UILabel>();
            this.mBoss     = transform.FindChild("Boss/BossNumLabel").GetComponent <UILabel>();
            string           level_id = LevelManager.m_CurLevel.level_id;
            SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(level_id);

            if (dataById != null)
            {
                if (dataById.scene_map_id.Equals("Map21"))
                {
                    transform.FindChild("TeamScore").gameObject.SetActive(false);
                    transform.FindChild("Kill").gameObject.SetActive(false);
                    transform.FindChild("Death").gameObject.SetActive(false);
                    transform.FindChild("Assists").gameObject.SetActive(false);
                    transform.FindChild("Boss").gameObject.SetActive(false);
                }
                else
                {
                    this.listener = TriggerManager.CreateGameEventTrigger(GameEvent.UpdateView, null, new TriggerAction(this.UpdateGoldView));
                }
            }
        }
 public override void Init()
 {
     base.Init();
     this.mGrid           = this.transform.FindChild("ParentRoot/Grid").GetComponent <UIGrid>();
     this.mEnemyCache     = this.transform.FindChild("EnemyCache").gameObject;
     this.mFriendListen   = TriggerManager.CreateGameEventTrigger(GameEvent.GameStart, null, new TriggerAction(this.ShowFriendsInfo));
     this._playerInfoPool = new ObjectRecycler <PlayersInfoItem>(new Func <PlayersInfoItem>(this.CreatePlayerInfo), delegate(PlayersInfoItem x)
     {
         UnityEngine.Object.Destroy(x.gameObject);
     });
 }
    public void RegisterPlayerEvent()
    {
        Units player = PlayerControlMgr.Instance.GetPlayer();

        this._watchTarget = player;
        this.ReSetMiniMapTapEvent();
        if (player != null)
        {
            this.deathTrigger = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.PlayerDeath), player.unique_id);
            TriggerManager.CreateGameEventTrigger(GameEvent.ChangePlayer, null, new TriggerAction(this.ChangePlayer));
        }
        this.SetRoleObj(player, true);
    }
Exemple #4
0
        public override void HandleAfterOpenModule()
        {
            this.isReplayMode = GameManager.Instance.ReplayController.IsReplayStart;
            SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>("80007");

            if (dataById != null)
            {
                this.battleTime = (int)dataById.hero2_nb_time;
            }
            if (this.cMgr == null)
            {
                this.cMgr = new CoroutineManager();
            }
            this.dataReady = false;
            MobaMessageManager.RegistMessage((ClientMsg)25038, new MobaMessageFunc(this.DoWhenSpawnFinished));
            this.cMgr.StartCoroutine(this.DoInitComps(), true);
            this.mTimeTask = this.cMgr.StartCoroutine(this.RecordTime(), true);
            this.listener  = TriggerManager.CreateGameEventTrigger(GameEvent.UpdateView, null, new TriggerAction(this.UpdateView));
        }
 private void ReSetMiniMapTapEvent()
 {
     if (this.tapMiniMapDownTrigger != null)
     {
         TriggerManager.DestroyTrigger(this.tapMiniMapDownTrigger);
         this.tapMiniMapDownTrigger = null;
     }
     if (this.tapMiniMapUpTrigger != null)
     {
         TriggerManager.DestroyTrigger(this.tapMiniMapUpTrigger);
         this.tapMiniMapUpTrigger = null;
     }
     if (this.tapMiniMapDownTrigger == null)
     {
         this.tapMiniMapDownTrigger = TriggerManager.CreateGameEventTrigger(GameEvent.TapMiniMapDown, null, new TriggerAction(this.SetTouchMiniMapPosition));
     }
     if (this.tapMiniMapUpTrigger == null)
     {
         this.tapMiniMapUpTrigger = TriggerManager.CreateGameEventTrigger(GameEvent.TapMiniMapUp, null, new TriggerAction(this.RestoreCameraController));
     }
 }
Exemple #6
0
 private VTrigger CreateTriger(BattleRefreshVo br)
 {
     if (!this._battleRefreshList.ContainsKey(br.br_id))
     {
         this._battleRefreshList.Add(br.br_id, br);
         VTrigger vTrigger = null;
         if (br.trigerCdn == GameEvent.TimeTigger)
         {
             this._battleTimeTrigger.Add(br.br_id);
         }
         else
         {
             vTrigger = TriggerManager.CreateGameEventTrigger(br.trigerCdn, this.GetTriggerCondition(br), new TriggerAction(this.DoSpawnerByTrigger));
             if (vTrigger != null)
             {
                 this._battleTriggerList.Add(vTrigger.trigger_id, br.br_id);
             }
         }
         return(vTrigger);
     }
     return(null);
 }
    private void ChangePlayer()
    {
        if (this.deathTrigger != null)
        {
            TriggerManager.DestroyTrigger(this.deathTrigger);
            this.deathTrigger = null;
        }
        Units player = PlayerControlMgr.Instance.GetPlayer();

        this._watchTarget = player;
        if (player != null && player.isLive)
        {
            this.deathTrigger = TriggerManager.CreateUnitEventTrigger(UnitEvent.UnitDeath, null, new TriggerAction(this.PlayerDeath), player.unique_id);
            this.PlayerRespawn();
        }
        if (this.tapMiniMapDownTrigger == null)
        {
            this.tapMiniMapDownTrigger = TriggerManager.CreateGameEventTrigger(GameEvent.TapMiniMapDown, null, new TriggerAction(this.SetTouchMiniMapPosition));
        }
        if (this.tapMiniMapUpTrigger == null)
        {
            this.tapMiniMapUpTrigger = TriggerManager.CreateGameEventTrigger(GameEvent.TapMiniMapUp, null, new TriggerAction(this.RestoreCameraController));
        }
    }
Exemple #8
0
 private void RegisterTrigger()
 {
     this.ReplayGame = TriggerManager.CreateGameEventTrigger(GameEvent.CleanAllData, null, new TriggerAction(this.ReUpdate));
 }
 private void RegisterTrigger()
 {
     this.ChangePlayerTrigger = TriggerManager.CreateGameEventTrigger(GameEvent.ChangePlayer, null, new TriggerAction(this.ChangePlayer));
 }
Exemple #10
0
 private void RegisterTrigger()
 {
     this.ChangePlayerTrigger = TriggerManager.CreateGameEventTrigger(GameEvent.ChangePlayer, null, new TriggerAction(this.ChangePlayer));
     this.RestarTrigger       = TriggerManager.CreateGameEventTrigger(GameEvent.GameRestart, null, new TriggerAction(this.ReplayHeadView));
 }
 private void Register()
 {
     TriggerManager.CreateGameEventTrigger(GameEvent.MainPlayerHitted, null, new TriggerAction(this.OnMainPlayerHitted));
     MobaMessageManagerTools.RegistMsg(this, this.msgList, true, "OnMsg_");
 }
Exemple #12
0
        public override void Init()
        {
            base.Init();
            this.skillItem           = ResourceManager.LoadPath <SkillShowItem>("Prefab/UI/PlayHUD/SkillShowItem", null, 0);
            this.ChangePlayerTrigger = TriggerManager.CreateGameEventTrigger(GameEvent.ChangePlayer, null, new TriggerAction(this.ChangePlayer));
            this.listener            = TriggerManager.CreateGameEventTrigger(GameEvent.UpdateView, null, new TriggerAction(this.UpdateGoldView));
            this.mFriendListen       = TriggerManager.CreateGameEventTrigger(GameEvent.GameStart, null, new TriggerAction(this.OnGameStart));
            this.PVEAnchor           = this.transform.Find("PVEAnchor");
            this.Kill               = this.transform.Find("PVEAnchor/Kill");
            this.Death              = this.transform.Find("PVEAnchor/Death");
            this.killLabel          = this.transform.Find("PVEAnchor/Kill/KillNumLabel").GetComponent <UILabel>();
            this.DeathLabel         = this.transform.Find("PVEAnchor/Death/DeathNumLabel").GetComponent <UILabel>();
            this.PVE_Boss           = this.PVEAnchor.Find("Boss/BossNumLabel").GetComponent <UILabel>();
            this.PVE_Assists        = this.PVEAnchor.Find("Assists/AssistsNumLabel").GetComponent <UILabel>();
            this.PVPAnchor          = this.transform.Find("PVPAnchor");
            this.PVP_KillLabel      = this.PVPAnchor.Find("Kill/KillNumLabel").GetComponent <UILabel>();
            this.PVP_Death          = this.PVPAnchor.Find("Death/DeathNumLabel").GetComponent <UILabel>();
            this.PVE_Time           = this.PVEAnchor.Find("Time/TimeLabel").GetComponent <UILabel>();
            this.PVP_Time           = this.PVPAnchor.Find("Time/TimeLabel").GetComponent <UILabel>();
            this.PVP_Assists        = this.PVPAnchor.Find("Assists/AssistsNumLabel").GetComponent <UILabel>();
            this.PVP_Boss           = this.PVPAnchor.Find("Boss/BossNumLabel").GetComponent <UILabel>();
            this.BottomRightAnchor  = this.transform.Find("BottomRightAnchor");
            this.bottomPveAnchor    = this.BottomRightAnchor.Find("Pve");
            this.bottomPvpAnchor    = this.BottomRightAnchor.Find("Pvp");
            this.LeftTopAnchor      = this.transform.Find("LeftTopAnchor");
            this.SkillPveBtn        = this.bottomPveAnchor.Find("SkillBtn");
            this.SkillPvpBtn        = this.bottomPvpAnchor.Find("SkillBtn");
            this.SkillPveSprite     = this.SkillPveBtn.GetComponent <UISprite>();
            this.SkillPveSprite2    = this.bottomPveAnchor.Find("SkillBtn/SkillBtn2").GetComponent <UISprite>();
            this.SkillPvpSprite     = this.SkillPvpBtn.GetComponent <UISprite>();
            this.SkillPvpSprite2    = this.bottomPvpAnchor.Find("SkillBtn/SkillBtn2").GetComponent <UISprite>();
            this.StatisticPveBtn    = this.bottomPveAnchor.Find("StatisticBtn");
            this.StatisticPvpBtn    = this.bottomPvpAnchor.Find("StatisticBtn");
            this.StatisticBtn1      = this.LeftTopAnchor.Find("StatisticBtn");
            this.B_Game             = this.transform.Find("Center/Game");
            this.Suspend            = this.bottomPveAnchor.Find("Suspend");
            this.Setting            = this.bottomPvpAnchor.Find("Setting");
            this.Suspend1           = this.LeftTopAnchor.Find("Suspend");
            this.FPSLabel           = this.transform.Find("Center/Game/FPS/Label").GetComponent <UILabel>();
            this.DelayLabel         = this.transform.Find("Center/Game/Delay/Label").GetComponent <UILabel>();
            this.BottomAnchor       = this.transform.Find("BottomAnchor");
            this.TestBtn            = this.bottomPveAnchor.Find("TestBtn");
            this.DebugObj           = this.bottomPvpAnchor.Find("Debug");
            this.ResetBtn           = this.bottomPveAnchor.Find("ResetBtn");
            this.SpeedBtn           = this.DebugObj.Find("SpeedBtn");
            this.SpeedLabel         = this.SpeedBtn.Find("speed").GetComponent <UILabel>();
            this.ResetSpeedBtn      = this.DebugObj.Find("ResetSpeedBtn");
            this.skillBackBg        = this.transform.Find("BottomAnchor/SkillBg/BackBg");
            this.LevelBtn           = this.DebugObj.Find("LevelBtn");
            this.EnableHeroAIBnt    = this.DebugObj.Find("Toggle/EnableHeroAI");
            this.EnableMonsterAIBnt = this.DebugObj.Find("Toggle/EnableMonsterAI");
            this.EnableTowerAIBnt   = this.DebugObj.Find("Toggle/EnableTowerAI");
            this.EnableAllAIBnt     = this.DebugObj.Find("Toggle/EnableAllAI");
            this.NoMonsterBnt       = this.DebugObj.Find("Toggle/NoMontser");
            this.NoSkillCdBnt       = this.DebugObj.Find("Toggle/NoSkillCd");
            this.NoSkillCostBnt     = this.DebugObj.Find("Toggle/NoSkillCost");
            this.WhoIsYourDady      = this.DebugObj.Find("Toggle/WhoIsYourDady");
            this.AddBlood           = this.DebugObj.Find("Toggle/AddBlood");
            this.Toggle             = this.DebugObj.Find("Toggle");
            this.heroTargetInfo     = this.transform.Find("TargetBox/HeroTarget");
            this.heroTexture        = this.heroTargetInfo.Find("Sprite/Texture").GetComponent <UITexture>();
            this.heroBloodSprite    = this.heroTargetInfo.Find("HPBar/SlideBlood").GetComponent <UISprite>();
            this.heroHpNumber       = this.heroTargetInfo.Find("HPBar/HPNumber").GetComponent <UILabel>();
            this.heroKillInfo       = this.heroTargetInfo.Find("KillInfo/KillNumber").GetComponent <UILabel>();
            this.otherTargetInfo    = this.transform.Find("TargetBox/OtherTarget");
            this.otherTexture       = this.otherTargetInfo.Find("Sprite/Texture").GetComponent <UITexture>();
            this.backTexture        = this.otherTexture.mainTexture;
            this.otherBloodSprite   = this.otherTargetInfo.Find("HPBar/HPBar/SlideBlood").GetComponent <UISprite>();
            this.otherHpNumber      = this.otherTargetInfo.Find("HPBar/HPBar/HPNumber").GetComponent <UILabel>();
            this.otherName          = this.otherTargetInfo.Find("Name/name").GetComponent <UILabel>();
            this.skillBg            = this.BottomAnchor.Find("SkillBg").GetComponent <UIPanel>();
            this.B_Grid             = this.BottomAnchor.Find("SkillBg/Grid").GetComponent <UIGrid>();
            UIEventListener.Get(this.Suspend.gameObject).onClick            = new UIEventListener.VoidDelegate(this.OnSuspend);
            UIEventListener.Get(this.Setting.gameObject).onClick            = new UIEventListener.VoidDelegate(this.OnSuspend);
            UIEventListener.Get(this.SkillPveBtn.gameObject).onClick        = new UIEventListener.VoidDelegate(this.ClickSkillBtn);
            UIEventListener.Get(this.SkillPvpBtn.gameObject).onClick        = new UIEventListener.VoidDelegate(this.ClickSkillBtn);
            UIEventListener.Get(this.SkillPveSprite2.gameObject).onClick    = new UIEventListener.VoidDelegate(this.ClickSkillBtn);
            UIEventListener.Get(this.SkillPvpSprite2.gameObject).onClick    = new UIEventListener.VoidDelegate(this.ClickSkillBtn);
            UIEventListener.Get(this.StatisticPveBtn.gameObject).onClick    = new UIEventListener.VoidDelegate(this.ClickStatisticBtn);
            UIEventListener.Get(this.StatisticPvpBtn.gameObject).onClick    = new UIEventListener.VoidDelegate(this.ClickStatisticBtn);
            UIEventListener.Get(this.StatisticBtn1.gameObject).onClick      = new UIEventListener.VoidDelegate(this.ClickStatisticBtn);
            UIEventListener.Get(this.Suspend1.gameObject).onClick           = new UIEventListener.VoidDelegate(this.OnSuspend);
            UIEventListener.Get(this.TestBtn.gameObject).onClick            = new UIEventListener.VoidDelegate(this.OnTestBtn);
            UIEventListener.Get(this.ResetBtn.gameObject).onClick           = new UIEventListener.VoidDelegate(this.OnResetBtn);
            UIEventListener.Get(this.SpeedBtn.gameObject).onClick           = new UIEventListener.VoidDelegate(this.OnSpeedBtn);
            UIEventListener.Get(this.ResetSpeedBtn.gameObject).onClick      = new UIEventListener.VoidDelegate(this.OnResetSpeedBtn);
            UIEventListener.Get(this.LevelBtn.gameObject).onClick           = new UIEventListener.VoidDelegate(this.OnLevelBtn);
            UIEventListener.Get(this.skillBackBg.gameObject).onClick        = new UIEventListener.VoidDelegate(this.OnskillBackBg);
            UIEventListener.Get(this.EnableHeroAIBnt.gameObject).onClick    = new UIEventListener.VoidDelegate(this.OnGameCommand);
            UIEventListener.Get(this.EnableTowerAIBnt.gameObject).onClick   = new UIEventListener.VoidDelegate(this.OnGameCommand);
            UIEventListener.Get(this.EnableMonsterAIBnt.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnGameCommand);
            UIEventListener.Get(this.EnableAllAIBnt.gameObject).onClick     = new UIEventListener.VoidDelegate(this.OnGameCommand);
            UIEventListener.Get(this.NoMonsterBnt.gameObject).onClick       = new UIEventListener.VoidDelegate(this.OnGameCommand);
            UIEventListener.Get(this.NoSkillCdBnt.gameObject).onClick       = new UIEventListener.VoidDelegate(this.OnGameCommand);
            UIEventListener.Get(this.NoSkillCostBnt.gameObject).onClick     = new UIEventListener.VoidDelegate(this.OnGameCommand);
            UIEventListener.Get(this.WhoIsYourDady.gameObject).onClick      = new UIEventListener.VoidDelegate(this.OnGameCommand);
            UIEventListener.Get(this.AddBlood.gameObject).onClick           = new UIEventListener.VoidDelegate(this.OnGameCommand);
            this.ResetFpsData();
            this.mFriendInfo       = this.transform.Find("BattleFriendNotice");
            this.mLockViewSprite   = this.transform.Find("BattleFriendNotice/DragPlayerView/LockSprite").GetComponent <UISprite>();
            this.mUnlockViewSprite = this.transform.Find("BattleFriendNotice/DragPlayerView/UnlockSprite").GetComponent <UISprite>();
            this.mFriendList       = this.transform.Find("BattleFriendNotice/FriendList");
            UIEventListener.Get(this.mLockViewSprite.gameObject).onClick   = new UIEventListener.VoidDelegate(this.OnPressLockView);
            UIEventListener.Get(this.mUnlockViewSprite.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnPressUnlockView);
            Units player = PlayerControlMgr.Instance.GetPlayer();

            this.ShowDebugPvp();
            this.bInitFriendFinished = false;
        }
Exemple #13
0
 public override void Init()
 {
     this._trigger = TriggerManager.CreateGameEventTrigger(GameEvent.ChangePlayer, null, new TriggerAction(this.OnChangePlayer));
     MobaMessageManager.RegistMessage((ClientMsg)25038, new MobaMessageFunc(this.OnSpawnFinished));
 }
Exemple #14
0
 private void RegisterTrigger()
 {
     this._changePlayerTrigger = TriggerManager.CreateGameEventTrigger(GameEvent.ChangePlayer, null, new TriggerAction(this.OnChangePlayer));
     MobaMessageManager.RegistMessage((ClientMsg)25030, new MobaMessageFunc(this.OnPvpStartGame));
 }