chenxin
2020-11-09 172d8ffbf5fe3bdd60b3d71a3a60feeed1cb1762
Assets/Scripts/TowerDefense/Agents/Agent.cs
@@ -296,6 +296,7 @@
        {
            this.configuration.maxHealth = health;
            this.configuration.startingHealth = health;
            this.configuration.SetMaxHealth(health);
            this.configuration.Init();
            this.configuration.SetHealth(health);
@@ -468,6 +469,8 @@
            timeToPoisonHurt = 0;
            bShieldBreak = false;
            bInDeathAct = false;
            configuration.ClearShieldWall();
            StopFrostParticle();
            //this.SetTargetableMatColor(Color.white);
@@ -875,6 +878,7 @@
        protected virtual void Update()
        {
            this.UpdateAction();
            HandleShieldWall();
            // 处理死亡状态了,不必再移动:
            if (bInDeathAct || !CanMove) return;
@@ -891,6 +895,25 @@
        }
        /// <summary>
        /// 处理魔法护盾血量值
        /// </summary>
        protected void HandleShieldWall()
        {
            if (configuration.IsExistShieldWall)
            {
                if (configuration.ShieldWallCurrentHealth <= 0.00001f)
                    configuration.IsExistShieldWall = false;
                else if (configuration.ShieldWallEffectiveTime > 0.00001f)
                {
                    if (configuration.ShieldWallRemainTime <= 0.00001f)
                        configuration.IsExistShieldWall = false;
                    else
                        configuration.ShieldWallRemainTime -= Time.deltaTime;
                }
            }
        }
        /// <summary>
        /// 限制当前Agent的移动位置,让Agent的移动看起来更帅一些
        /// </summary>
        protected void restrictAgentPos()