void Start() { clickSound = Deer.GetComponent <AudioSource>(); bgMusic = GetComponent <AudioSource>(); int randomnum = Random.Range(0, 5); for (int i = 0; i < randomnum; i++) { randomPos(x); } check2 = 0; check = 0; time = 0; BeariniPost = Bear.transform.position; FoxiniPost = Fox.transform.position; FroginiPost = Frog.transform.position; MiceiniPost = Mice.transform.position; CatiniPost = Cat.transform.position; KanciliniPost = Kancil.transform.position; CowiniPost = Cow.transform.position; DeeriniPost = Deer.transform.position; Cat.SetActive(false); Cow.SetActive(false); Kancil.SetActive(false); Bear.SetActive(false); Fox.SetActive(false); Frog.SetActive(false); Mice.SetActive(false); buttonnext1.SetActive(false); }
IEnumerator DeadState() { _deer.GetComponent <BoxCollider2D>().enabled = false; yield return(new WaitForSeconds(0.5f)); SetState("Init"); _deer.gameObject.SetActive(false); }