public void AttackEnd() { CharacterInfo attackCharInfo = towerInfo.GetAttackInfo(); //若死亡或者超出了攻击范围,则回归待机重新寻找目标 if (attackCharInfo.IsDead()) { attackCharInfo.ChangeState("die"); towerInfo.ChangeState("idle"); } else if (!towerInfo.WithinRange(attackCharInfo)) { towerInfo.ChangeState("idle"); } else { towerInfo.ChangeState("attack"); } }