public override void Init()
 {
     base.Init();
     this.mDragLock        = this.transform.FindChild("TopLeftAnchor/DragLock").gameObject;
     this.mSkillInfo       = this.transform.FindChild("BottomRightAnchor/SkillInfo").gameObject;
     this.mScoreBoard      = this.transform.FindChild("BottomRightAnchor/ScoreBoard").gameObject;
     this.mSkillInfoBg     = this.transform.Find("SkillAnchor/SkillBg/BackBg").gameObject;
     this.mSetting         = this.transform.FindChild("BottomRightAnchor/Setting").gameObject;
     this.mSkillAnchor     = this.transform.FindChild("SkillAnchor").gameObject;
     this.mSkillGird       = this.transform.FindChild("SkillAnchor/SkillBg/Grid").GetComponent <UIGrid>();
     this.mSkillItem       = ResourceManager.LoadPath <SkillShowItem>("Prefab/UI/PlayHUD/SkillShowItem", null, 0);
     this.tPos_DragLockBtn = this.mDragLock.GetComponent <TweenPosition>();
     this.tPos_ScoreBoard  = this.mScoreBoard.GetComponent <TweenPosition>();
     this.tPos_Setting     = this.mSetting.GetComponent <TweenPosition>();
     this.tPos_SkillInfo   = this.mSkillInfo.GetComponent <TweenPosition>();
     UIEventListener.Get(this.mDragLock).onClick    = new UIEventListener.VoidDelegate(this.OnClickDragLock);
     UIEventListener.Get(this.mSkillInfo).onClick   = new UIEventListener.VoidDelegate(this.OnClickSkillInfo);
     UIEventListener.Get(this.mSkillInfoBg).onClick = new UIEventListener.VoidDelegate(this.OnClickSkillInfo);
     UIEventListener.Get(this.mScoreBoard).onClick  = new UIEventListener.VoidDelegate(this.OnClickScoreBoard);
     UIEventListener.Get(this.mSetting).onClick     = new UIEventListener.VoidDelegate(this.OnClickSetting);
 }
Пример #2
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;
        }