Ejemplo n.º 1
0
        public override void Awake()
        {
            base.Awake();
            var t = mDMono.transform;

            BuffIconItems = new BuffIconItem[10];
            for (int i = 0; i < BuffIconItems.Length; i++)
            {
                BuffIconItems[i] = new BuffIconItem()
                {
                    IconSprite     = t.parent.GetComponent <UISprite>(String.Format("BossHeadInfo/BuffIcons/{0}", i)),
                    LeftTurnLabel  = t.parent.GetComponent <UILabel>(string.Format("BossHeadInfo/BuffIcons/{0}/Label_Depth1", i)),
                    OverlyingLabel = t.parent.GetComponent <UILabel>(string.Format("BossHeadInfo/BuffIcons/{0}/Label_Depth2", i))
                };
            }
            Container         = t.FindEx("Container").gameObject;
            NameLabel         = t.parent.GetComponent <UILabel>("BossHeadInfo/Name");
            Indicator         = t.parent.GetComponent <UILabel>("BossHeadInfo/BuffIcons/Indicator/Label_Depth1");
            Icon              = t.parent.GetComponent <UISprite>("BossHeadInfo/Icon/Sprite2");
            NextSkillIcon     = t.parent.GetComponent <DynamicUISprite>("BossHeadInfo/NextSkillIcon");
            CurrentHPPipe     = t.parent.GetComponent <UISprite>("BossHeadInfo/Hp");
            CurrentHPPipeMask = t.parent.GetComponent <UISprite>("BossHeadInfo/Hp/Hp (1)");
            LerpHPPipe        = t.parent.GetComponent <UISprite>("BossHeadInfo/HpLerp");
            NextHPPipe        = t.parent.GetComponent <UISprite>("BossHeadInfo/HpNext");
            MonsterType       = t.parent.GetComponent <UISprite>("BossHeadInfo/Icon/Type");
            HPPipeNumLabel    = t.parent.GetComponent <UILabel>("BossHeadInfo/HipeNum/Label");
            MoveBarProgress   = t.parent.GetComponent <UIProgressBar>("BossHeadInfo/MoveBarBG");
            HeadHud           = t.parent.FindEx("BossHeadInfo").gameObject;
            SkillListHud      = t.FindEx("Container/SkillList").gameObject;
            BSItem            = t.GetMonoILRComponent <BossSkillItem>("Container/SkillList/SkillItem");
            SkillGrid         = t.GetComponent <UIGrid>("Container/SkillList/Grid");
            BuffGrid          = t.parent.GetComponent <UIGrid>("BossHeadInfo/BuffIcons");
            NextSkillTipsHud  = t.FindEx("Container/Panel/NextSkillTips").gameObject;
            NextSkillItem     = t.GetMonoILRComponent <BossSkillItem>("Container/Panel/NextSkillTips/SkillItem");
            LerpHpSpeed       = 0.3f;
            ChestObj          = t.parent.FindEx("BossHeadInfo/ChestNum").gameObject;
            ChestNum          = t.parent.GetComponent <UILabel>("BossHeadInfo/ChestNum/Label");
            HpObj             = t.parent.FindEx("BossHeadInfo/HipeNum").gameObject;
            PSJumpObj         = t.parent.FindEx("BossHeadInfo/ChestNum/ps_0").gameObject;
            PSLightObj        = t.parent.FindEx("BossHeadInfo/ChestNum/ps_1").gameObject;
            ChestImage        = t.parent.GetComponent <UISprite>("BossHeadInfo/ChestNum");
            HurtLabel         = t.parent.GetComponent <UILabel>("BossHeadInfo/HurtLabel");

            t.GetComponent <UIEventTrigger>("Container/SkillList").onClick.Add(new EventDelegate(OnCloseSkillTips));
            t.GetComponent <UIEventTrigger>("Container/SkillList/SkillGuideBlar").onClick.Add(new EventDelegate(OnCloseSkillTips));
            t.GetComponent <UIEventTrigger>("Container/Panel/NextSkillTips").onClick.Add(new EventDelegate(OnCloseNextSkillTips));


            Hotfix_LT.Messenger.AddListener <Hotfix_LT.Combat.CombatHitDamageEvent>(Hotfix_LT.EventName.CombatHitDamageEvent, OnHitCombatantListener);

            //EventManager.instance.AddListener<CombatHitDamageEvent>(OnHitCombatantListener);
            //EventManager.instance.AddListener<CombatDamageEvent>(OnDamageListener);  //TODO
            PerPipeSpriteLength = NextHPPipe.width;
            Container.gameObject.SetActive(false);
            HeadHud.gameObject.SetActive(false);
            SkillListHud.gameObject.SetActive(false);
            NextSkillTipsHud.gameObject.SetActive(false);
            playPSList = new List <int>();
        }
Ejemplo n.º 2
0
        public override void Awake()
        {
            base.Awake();

            var t = mDMono.transform;

            BuffIconItems    = new BuffIconItem[4];
            BuffIconItems[0] = new BuffIconItem()
            {
                IconSprite     = t.GetComponent <UISprite>("Container/BuffList/0"),
                LeftTurnLabel  = t.GetComponent <UILabel>("Container/BuffList/0/Label_Depth4"),
                OverlyingLabel = t.GetComponent <UILabel>("Container/BuffList/0/Label_Depth3")
            };
            BuffIconItems[1] = new BuffIconItem()
            {
                IconSprite     = t.GetComponent <UISprite>("Container/BuffList/1"),
                LeftTurnLabel  = t.GetComponent <UILabel>("Container/BuffList/1/Label_Depth4"),
                OverlyingLabel = t.GetComponent <UILabel>("Container/BuffList/1/Label_Depth3")
            };
            BuffIconItems[2] = new BuffIconItem()
            {
                IconSprite     = t.GetComponent <UISprite>("Container/BuffList/2"),
                LeftTurnLabel  = t.GetComponent <UILabel>("Container/BuffList/2/Label_Depth4"),
                OverlyingLabel = t.GetComponent <UILabel>("Container/BuffList/2/Label_Depth3")
            };
            BuffIconItems[3] = new BuffIconItem()
            {
                IconSprite     = t.GetComponent <UISprite>("Container/BuffList/3"),
                LeftTurnLabel  = t.GetComponent <UILabel>("Container/BuffList/3/Label_Depth4"),
                OverlyingLabel = t.GetComponent <UILabel>("Container/BuffList/3/Label_Depth3")
            };

            container = t.FindEx("Container").gameObject;
            healthProgressBarRenderer = t.GetComponent <UIProgressBar>("Container/HealthBarRenderer");
            healthBarHpColorRenderer  = t.GetComponent <UISprite>("Container/HealthBarRenderer/Foreground_Depth1");
            moveBarProgressRenderer   = t.GetComponent <UIProgressBar>("Container/MoveBarRenderer");
            flagObj      = t.FindEx("Container/Flag").gameObject;
            AttrRenderer = t.GetComponent <UISprite>("Container/Flag/AttrFlag_Depth3");
            hpRenderer   = t.GetComponent <UILabel>("Container/HealthBarRenderer/HpRenderer_Depth4");
            convergeFlag = t.FindEx("Container/Flag/ConvergeFlag_Depth1").gameObject;
            isConverge   = false;
            restrainFlag = t.GetComponent <UISprite>("Container/Flag/RestrainFlag_Depth2");
            buffAnchor   = t.GetComponent <Transform>("Container/BuffAnchor");
        }