| | |
| | | public SpawnAgentType AgentType { get; set; } = SpawnAgentType.Normal; |
| | | |
| | | /// <summary> |
| | | /// 无尽模式小怪对应 endless_enemy表中数据 |
| | | /// </summary> |
| | | public endless_enemy EnemyData { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Accessor to <see cref="m_NavMeshAgent"/> |
| | | /// </summary> |
| | | public NavMeshAgent navMeshNavMeshAgent |
| | |
| | | { |
| | | this.configuration.maxHealth = health; |
| | | this.configuration.startingHealth = health; |
| | | this.configuration.SetMaxHealth(health); |
| | | this.configuration.Init(); |
| | | this.configuration.SetHealth(health); |
| | | |
| | |
| | | /// 处理Agent的锁定Buf,播放特效,设置速度为零,并时间到达后重设数据。 |
| | | /// </summary> |
| | | /// <param name="binfo"></param> |
| | | protected void SetAgentStopBuff(buffinfo binfo) |
| | | protected virtual void SetAgentStopBuff(buffinfo binfo) |
| | | { |
| | | MoveStopTime = binfo.last / 1000; |
| | | |
| | |
| | | { |
| | | // 统一管理器内删除当前的Agent: |
| | | AgentInsManager.instance.removeAgent(this); |
| | | |
| | | EventCenter.Ins.BroadCast((int)KTGMGemClient.EventType.EndlessAgentDead, this); |
| | | base.Remove(); |
| | | |
| | | if (m_LevelManager) m_LevelManager.DecrementNumberOfEnemies(); |
| | |
| | | timeToPoisonHurt = 0; |
| | | bShieldBreak = false; |
| | | bInDeathAct = false; |
| | | |
| | | configuration.ClearShieldWall(); |
| | | |
| | | StopFrostParticle(); |
| | | //this.SetTargetableMatColor(Color.white); |
| | |
| | | // 统一管理器内删除当前的Agent: |
| | | AgentInsManager.instance.removeAgent(this); |
| | | this.Remove(); |
| | | Debug.Log("删除多余的攻击Agent."); |
| | | } |
| | | } |
| | | } |
| | |
| | | protected virtual void Update() |
| | | { |
| | | this.UpdateAction(); |
| | | HandleShieldWall(); |
| | | |
| | | // 处理死亡状态了,不必再移动: |
| | | if (bInDeathAct || !CanMove) return; |
| | |
| | | // 计算中毒相关. |
| | | if ((poisonTimes > 0) && (poisonHurt > 0)) |
| | | updatePoison(Time.deltaTime); |
| | | } |
| | | |
| | | /// <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> |
| | |
| | | if (mAnim == null) |
| | | { |
| | | changeMat = GetComponent<ChangeMat>(); |
| | | changeMat?.SetSelf(this.opponentAgent, CheckHealth,Die); |
| | | changeMat?.SetSelf(this.opponentAgent, CheckHealth, Die); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | public void PlayAttack() |
| | | { |
| | | AudioSourceManager.Ins.Play(AudioEnum.AttackTower); |
| | | if (mAnim) |
| | | mAnim.SetBool("Attack", true); |
| | | else if (changeMat) |