Esempio n. 1
0
        public void Run(long id, float value)
        {
            FUIHeadBar headBar = Game.Scene.GetComponent <FUIComponent>().Get(id) as FUIHeadBar;

            headBar.Bar_HP.self.TweenValue(UnitComponent.Instance.Get(id).GetComponent <HeroDataComponent>().GetAttribute(NumericType.Hp),
                                           0.2f);
        }
        public override void Run(long fuiId, float maxMP)
        {
            //Log.Info($"事件收到的血条ID为{fuiId}");
            FUIHeadBar headBar = Game.Scene.GetComponent <FUIComponent>().Get(fuiId) as FUIHeadBar;

            headBar.Bar_MP.self.max = maxMP;
        }
        public override void Run(long fuiId, float changedValue)
        {
            //Log.Info($"事件收到的将要改变的数值为{changedValue}");
            FUIHeadBar headBar = Game.Scene.GetComponent <FUIComponent>().Get(fuiId) as FUIHeadBar;

            headBar.Bar_MP.self.TweenValue(
                ETModel.Game.Scene.GetComponent <UnitComponent>().Get(fuiId).GetComponent <HeroDataComponent>().CurrentMagicValue, 0.2f);
        }
        public override void Run(long fuiId, float changedValue)
        {
            //Log.Info($"事件收到的血条ID为{fuiId}");
            FUIHeadBar headBar = Game.Scene.GetComponent <FUIComponent>().Get(fuiId) as FUIHeadBar;

            headBar.Bar_HP.self.TweenValue(
                ETModel.Game.Scene.GetComponent <UnitComponent>().Get(fuiId).GetComponent <HeroDataComponent>().CurrentLifeValue,
                0.2f);
            Game.Scene.GetComponent <M5V5GameComponent>().GetHotfixUnit(fuiId).GetComponent <FallingFontComponent>().Play(changedValue);
        }
Esempio n. 5
0
        public override void Run(long fuiId)
        {
            this.RunInternal().Coroutine();
            var hotfixui = FUIHeadBar.CreateInstance();

            //默认将会以Id为Name,也可以自定义Name,方便查询和管理,这里使用血条归属的Unit id作为Name
            hotfixui.Name = fuiId.ToString();
            //Log.Info($"这个英雄血条id为{hotfixui.Name}");
            hotfixui.MakeFullScreen();
            Game.Scene.GetComponent <FUIComponent>().Add(hotfixui, true);
        }
        public override void Run(long fuiId)
        {
            ETModel.Game.Scene.GetComponent <FUIPackageComponent>().AddPackage(FUIPackage.FUIHeadBar);
            var hotfixui = FUIHeadBar.CreateInstance();

            //默认将会以Id为Name,也可以自定义Name,方便查询和管理
            hotfixui.Name = fuiId.ToString();
            //Log.Info($"这个英雄血条id为{hotfixui.Name}");
            hotfixui.MakeFullScreen();
            Game.Scene.GetComponent <FUIComponent>().Add(hotfixui, true);
        }
Esempio n. 7
0
 public override void Dispose()
 {
     if (this.IsDisposed)
     {
         return;
     }
     base.Dispose();
     m_Hero                  = null;
     m_HeadBar               = null;
     m_Hero2Screen           = Vector2.zero;
     this.m_HeadBarScreenPos = Vector2.zero;
 }
        public void Awake(Unit hero, FUI headBar)
        {
            this.m_Hero = hero;
            HeroDataComponent heroDataComponent = hero.GetComponent <HeroDataComponent>();

            this.m_HeadBar = headBar as FUIHeadBar;
            //这个血量最大值有点特殊,还需要设置一下密度用事件比较好一点
            Game.EventSystem.Run(EventIdType.ChangeHPMax, hero.Id, heroDataComponent.MaxLifeValue);
            this.m_HeadBar.Bar_HP.self.value = heroDataComponent.MaxLifeValue;
            this.m_HeadBar.Bar_MP.self.max   = heroDataComponent.MaxMagicValue;
            this.m_HeadBar.Bar_MP.self.value = heroDataComponent.MaxMagicValue;
        }
Esempio n. 9
0
        public void Awake(Unit hero, FUI headBar)
        {
            this.m_Hero = hero;
            HeroDataComponent heroDataComponent = hero.GetComponent <HeroDataComponent>();

            this.m_HeadBar = headBar as FUIHeadBar;
            //这个血量最大值有点特殊,还需要设置一下密度用事件比较好一点

            this.SetDensityOfBar(this.m_Hero.GetComponent <HeroDataComponent>().GetAttribute(NumericType.MaxHp));
            this.m_HeadBar.Bar_HP.self.value = heroDataComponent.GetAttribute(NumericType.MaxHp);
            this.m_HeadBar.Bar_MP.self.max   = heroDataComponent.GetAttribute(NumericType.MaxMp);
            this.m_HeadBar.Bar_MP.self.value = heroDataComponent.GetAttribute(NumericType.MaxMp);
        }
        public override void Run(long fuiId, float maxHP)
        {
            //Log.Info($"事件收到的血条ID为{fuiId}");
            FUIHeadBar headBar = Game.Scene.GetComponent <FUIComponent>().Get(fuiId) as FUIHeadBar;
            float      actual  = 0;

            if (maxHP % 100 - 0 <= 0.1f)
            {
                actual = maxHP / 100 + 1;
            }
            else
            {
                actual = maxHP / 100 + 2;
            }

            headBar.Bar_HP.self.max     = maxHP;
            headBar.HPGapList.numItems  = (int)actual;
            headBar.HPGapList.columnGap = (int)(headBar.HPGapList.actualWidth / (actual - 1));
            //ETModel.Log.Info($"此次更新间距:{headBar.HPGapList.columnGap}");
        }
Esempio n. 11
0
        public void Run(long id, float value)
        {
            FUIHeadBar headBar = Game.Scene.GetComponent <FUIComponent>().Get(id) as FUIHeadBar;

            headBar.Bar_MP.self.max = value;
        }