public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { base.OnStateEnter(animator, stateInfo, layerIndex); this.shootingLogic = this.Drone.GetComponentInChildren <DroneShooting>(); this.DroneLogic.SignalLight.DronMode = enumDronMode.Attack; this.DroneLogic.DroneShield.DronMode = enumDronMode.Attack; this.DroneLogic.StartAttackMode(); // to highlight command in UI GameObject.FindGameObjectWithTag(Resources.Tags.CommandAttack).GetComponent <UnityEngine.UI.Text>().color = Color.white; this.NavAgent.updateRotation = false; //this.NavAgent.stoppingDistance = 10f; this.NavAgent.speed = this.DroneLogic.AttackSpeed; this.NavAgent.angularSpeed = this.DroneLogic.AttackAngularSpeed; this.NavAgent.acceleration = this.DroneLogic.AttackAcceleration; }
void Awake() { player = GameObject.FindGameObjectWithTag(Tags.player).transform; droneShooting = GetComponent <DroneShooting>(); droneHealth = GetComponent <DroneHealth>(); }