chenxin
2020-11-04 80b4237334a773b29bf69f38532a90ca659b3bfe
Assets/Scripts/TowerDefense/Agents/Agent.cs
@@ -209,6 +209,7 @@
        public bool bInDeathState
        {
            get { return this.bInDeathAct; }
            set { bInDeathAct = value; }
        }
        /// <summary>
@@ -243,8 +244,10 @@
        /// </summary>
        protected bool nodeMoveUpdate = false;
        /// <summary>
        /// 代理的类型
        /// </summary>
        public SpawnAgentType AgentType { get; set; } = SpawnAgentType.Normal;
        /// <summary>
        /// Accessor to <see cref="m_NavMeshAgent"/>
@@ -852,11 +855,17 @@
        {
            if (this.healthVal <= 0.1)
            {
                // 统一管理器内删除当前的Agent:
                AgentInsManager.instance.removeAgent(this);
                this.Remove();
                Die();
                //Debug.Log("删除多余的攻击Agent.");
            }
        }
        private void Die()
        {
            // 统一管理器内删除当前的Agent:
            AgentInsManager.instance.removeAgent(this);
            this.Remove();
        }
        /// <summary>
@@ -997,7 +1006,7 @@
            if (mAnim == null)
            {
                changeMat = GetComponent<ChangeMat>();
                changeMat?.SetSelf(this.opponentAgent,CheckHealth);
                changeMat?.SetSelf(this.opponentAgent, CheckHealth,Die);
            }
        }