/// <summary> /// Assigns values upon entry. /// </summary> public override void Enter() { AttackSprite.SetActive(true); AIagent.velocity = Vector3.zero; Debug.Log(owner.name + " entered AttackState"); AIagent.speed = MoveSpeed * 2.2f; }
/// <summary> /// Sets values upon entry and activates attack method depending if the target is of type "Cow" or "Player". /// </summary> public override void Enter() { timer = 0; AIagent.isStopped = true; AttackSprite.SetActive(true); if (Target.gameObject.CompareTag("Cow")) { Target.GetComponent <CowSM>().AttackTheCow(Damage); } else if (Target.gameObject.CompareTag("Player")) { Target.GetComponent <PlayerStateMashine>().GetAttacked(Damage); } }
/// <summary> /// Disables the sprite upon exit. /// </summary> public override void Exit() { AttackSprite.SetActive(false); }
/// <summary> /// Reactivates the movement /// </summary> public override void Exit() { AttackSprite.SetActive(false); AIagent.isStopped = false; }