daily pastebin goal
95%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top