Exemplo n.º 1
0
        public void Run(long a, float b)
        {
            if (a != UnitComponent.Instance.MyUnit.Id)
            {
                return;
            }
            FUI5V5Map fui5V5Map = Game.Scene.GetComponent <FUIComponent>().Get(FUI5V5Map.UIPackageName) as FUI5V5Map;

            fui5V5Map.AttackInfo.text = ((int)b).ToString();
        }
        public override void Run(long a, float b)
        {
            if (a != ETModel.Game.Scene.GetComponent <UnitComponent>().MyUnit.Id)
            {
                return;
            }
            FUI5V5Map fui5V5Map = Game.Scene.GetComponent <FUIComponent>().Get(FUI5V5Map.UIPackageName) as FUI5V5Map;

            fui5V5Map.BlueProBar.self.max = b;
            fui5V5Map.BlueText.text       = $"{fui5V5Map.BlueProBar.self.value}/{fui5V5Map.BlueProBar.self.max}";
        }
Exemplo n.º 3
0
        public void Run(long a, float b)
        {
            if (a != UnitComponent.Instance.MyUnit.Id)
            {
                return;
            }
            FUI5V5Map fui5V5Map = Game.Scene.GetComponent <FUIComponent>().Get(FUI5V5Map.UIPackageName) as FUI5V5Map;

            fui5V5Map.BlueProBar.self.TweenValue(UnitComponent.Instance.MyUnit.GetComponent <HeroDataComponent>().GetAttribute(NumericType.Mp), 0.2f);
            fui5V5Map.BlueText.text = $"{fui5V5Map.BlueProBar.self.value}/{fui5V5Map.BlueProBar.self.max}";
        }
        public override void Run(long a, float b)
        {
            if (a != ETModel.Game.Scene.GetComponent <UnitComponent>().MyUnit.Id)
            {
                return;
            }
            FUI5V5Map fui5V5Map = Game.Scene.GetComponent <FUIComponent>().Get(FUI5V5Map.UIPackageName) as FUI5V5Map;

            fui5V5Map.RedProBar.self.TweenValue(
                ETModel.Game.Scene.GetComponent <UnitComponent>().MyUnit.GetComponent <HeroDataComponent>().CurrentLifeValue, 0.2f);
            fui5V5Map.RedText.text = $"{fui5V5Map.RedProBar.self.value}/{fui5V5Map.RedProBar.self.max}";
        }
        public override void Run()
        {
            //加载UI资源
            ETModel.Game.Scene.GetComponent <FUIPackageComponent>().AddPackage(FUIPackage.FUI5v5Map);
            //创建UI实例
            var hotfixui = FUI5V5Map.CreateInstance();

            //默认将会以Id为Name,也可以自定义Name,方便查询和管理
            hotfixui.Name = FUIPackage.FUI5v5Map;
            //设置UI为全屏大小
            hotfixui.MakeFullScreen();
            //将UI注册到FUIComponent中,正式显示
            Game.Scene.GetComponent <FUIComponent>().Add(hotfixui, true);
        }
Exemplo n.º 6
0
        public override void Run()
        {
            //加载UI资源
            this.RunInternal().Coroutine();
            //创建UI实例
            var hotfixui = FUI5V5Map.CreateInstance();

            //默认将会以Id为Name,也可以自定义Name,方便查询和管理
            hotfixui.Name = FUIPackage.FUI5v5Map;
            hotfixui.GObject.sortingOrder = 39;
            //设置UI为全屏大小
            hotfixui.MakeFullScreen();
            //将UI注册到FUIComponent中,正式显示
            Game.Scene.GetComponent <FUIComponent>().Add(hotfixui, true);
        }
        public override void Run(long a, float b)
        {
            FUI5V5Map fui5V5Map = Game.Scene.GetComponent <FUIComponent>().Get(FUI5V5Map.UIPackageName) as FUI5V5Map;

            //第一次抛出事件的时候可能UI还没有加载出来
            if (fui5V5Map == null)
            {
                return;
            }
            if (a != ETModel.Game.Scene.GetComponent <UnitComponent>().MyUnit.Id)
            {
                return;
            }
            fui5V5Map.RedProBar.self.max = b;
            fui5V5Map.RedText.text       = $"{fui5V5Map.RedProBar.self.value}/{fui5V5Map.RedProBar.self.max}";
        }
Exemplo n.º 8
0
        public void Run(long id, float value)
        {
            FUI5V5Map fui5V5Map = Game.Scene.GetComponent <FUIComponent>().Get(FUI5V5Map.UIPackageName) as FUI5V5Map;

            //第一次抛出事件的时候可能UI还没有加载出来
            if (fui5V5Map == null)
            {
                return;
            }
            if (id != UnitComponent.Instance.MyUnit.Id)
            {
                return;
            }
            fui5V5Map.RedProBar.self.max = value;
            fui5V5Map.RedText.text       = $"{fui5V5Map.RedProBar.self.value}/{fui5V5Map.RedProBar.self.max}";
        }
        public void Update()
        {
            //TODO 先硬编码一波,这一块要放到行为树去处理的
            fui5V5Map = Game.Scene.GetComponent <FUIComponent>().Get(FUI5V5Map.UIPackageName) as FUI5V5Map;
            if (fui5V5Map == null)
            {
                return;
            }

            if (this.userInputComponent.QDown)
            {
                SessionComponent.Instance.Session.Send(new UserInput_SkillCmd()
                {
                    Message = "Q"
                });
                if (fui5V5Map.SkillQ_CDInfo.visible)
                {
                    return;
                }
                fui5V5Map.SkillQ_CDInfo.text    = "5";
                fui5V5Map.SkillQ_CDInfo.visible = true;
                fui5V5Map.SkillQ_Bar.self.value = 100;
                fui5V5Map.SkillQ_Bar.Visible    = true;
                fui5V5Map.SkillQ_Bar.self.TweenValue(0, 5).OnComplete(() =>
                {
                    fui5V5Map.SkillQ_CDInfo.visible = false;
                    fui5V5Map.SkillQ_Bar.Visible    = false;
                });
                m_CDComponent.TriggerCD(this.Entity.Id, "QCD");
            }

            if (this.userInputComponent.WDown)
            {
                SessionComponent.Instance.Session.Send(new UserInput_SkillCmd()
                {
                    Message = "W"
                });
                if (fui5V5Map.SkillW_CDInfo.visible)
                {
                    return;
                }
                fui5V5Map.SkillW_CDInfo.text      = "7";
                fui5V5Map.SkillW_CDInfo.visible   = true;
                fui5V5Map.SkillW_Bar.self.value   = 100;
                fui5V5Map.SkillW_Bar.self.visible = true;
                fui5V5Map.SkillW_Bar.self.TweenValue(0, 7).OnComplete(() =>
                {
                    fui5V5Map.SkillW_CDInfo.visible   = false;
                    fui5V5Map.SkillW_Bar.self.visible = false;
                });
                m_CDComponent.TriggerCD(this.Entity.Id, "WCD");
            }

            if (this.userInputComponent.EDown)
            {
                SessionComponent.Instance.Session.Send(new UserInput_SkillCmd()
                {
                    Message = "E"
                });
                if (fui5V5Map.SkillE_CDInfo.visible)
                {
                    return;
                }
                fui5V5Map.SkillE_CDInfo.text      = "10";
                fui5V5Map.SkillE_CDInfo.visible   = true;
                fui5V5Map.SkillE_Bar.self.value   = 100;
                fui5V5Map.SkillE_Bar.self.visible = true;
                fui5V5Map.SkillE_Bar.self.TweenValue(0, 10).OnComplete(() =>
                {
                    fui5V5Map.SkillE_CDInfo.visible   = false;
                    fui5V5Map.SkillE_Bar.self.visible = false;
                });
                m_CDComponent.TriggerCD(this.Entity.Id, "ECD");
            }

            if (this.userInputComponent.RDown)
            {
                SessionComponent.Instance.Session.Send(new UserInput_SkillCmd()
                {
                    Message = "R"
                });
            }

            long currentTime = TimeHelper.ClientNow();

            if (fui5V5Map.SkillQ_CDInfo.visible)
            {
                fui5V5Map.SkillQ_CDInfo.text = ((int)Math.Ceiling((double)(this.m_QCDInfo.LastTriggerTimer + this.m_QCDInfo.Interval - currentTime) / 1000))
                                               .ToString();
            }

            if (fui5V5Map.SkillW_CDInfo.visible)
            {
                fui5V5Map.SkillW_CDInfo.text = ((int)Math.Ceiling((double)(this.m_WCDInfo.LastTriggerTimer + this.m_WCDInfo.Interval - currentTime) / 1000))
                                               .ToString();
            }

            if (fui5V5Map.SkillE_CDInfo.visible)
            {
                fui5V5Map.SkillE_CDInfo.text = ((int)Math.Ceiling((double)(this.m_ECDInfo.LastTriggerTimer + this.m_ECDInfo.Interval - currentTime) / 1000))
                                               .ToString();
            }
        }