Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void MovingEnemy()
- {
- if (transform.position == MovePosition)
- {
- if (currentState == currentStateEnum.ANGRY)
- {
- GameObject.Find("Player").GetComponent<Player>().lives--;
- }
- this.gameObject.SetActive(false);
- }
- else
- {
- Vector3 newPos = Vector3.MoveTowards(transform.position, MovePosition, speed * Time.deltaTime);
- transform.position = newPos;
- }
- if (transform.position == SpawnPosition && currentState == currentStateEnum.HAPPY)
- {
- this.gameObject.SetActive(false);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement