Advertisement
Guest User

Untitled

a guest
Feb 13th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.64 KB | None | 0 0
  1. void MovingEnemy()
  2.     {
  3.         if (transform.position == MovePosition)
  4.         {
  5.             if (currentState == currentStateEnum.ANGRY)
  6.             {
  7.                 GameObject.Find("Player").GetComponent<Player>().lives--;
  8.             }
  9.             this.gameObject.SetActive(false);
  10.         }
  11.         else
  12.         {
  13.             Vector3 newPos = Vector3.MoveTowards(transform.position, MovePosition, speed * Time.deltaTime);
  14.             transform.position = newPos;
  15.         }
  16.         if (transform.position == SpawnPosition && currentState == currentStateEnum.HAPPY)
  17.         {
  18.             this.gameObject.SetActive(false);
  19.         }
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement