示例#1
0
 /// <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;
 }
示例#2
0
 /// <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);
     }
 }
示例#3
0
 /// <summary>
 /// Disables the sprite upon exit.
 /// </summary>
 public override void Exit()
 {
     AttackSprite.SetActive(false);
 }
示例#4
0
 /// <summary>
 /// Reactivates the movement
 /// </summary>
 public override void Exit()
 {
     AttackSprite.SetActive(false);
     AIagent.isStopped = false;
 }