From 172d8ffbf5fe3bdd60b3d71a3a60feeed1cb1762 Mon Sep 17 00:00:00 2001
From: chenxin <chenxin6991@163.com>
Date: Mon, 09 Nov 2020 16:37:47 +0800
Subject: [PATCH] Merge commit '894e974d944190fb2e10e14827f0d878626bd048' into master

---
 Assets/Scripts/TowerDefense/Agents/Agent.cs |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/Assets/Scripts/TowerDefense/Agents/Agent.cs b/Assets/Scripts/TowerDefense/Agents/Agent.cs
index 2fceb1c..19c9003 100644
--- a/Assets/Scripts/TowerDefense/Agents/Agent.cs
+++ b/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()

--
Gitblit v1.9.1