IEnumerator HideAnimal() { Debug.Log(timeNuoi); yield return(new WaitForSeconds(1f)); timeNuoi--; txtTime.text = (timeNuoi / 60).ToString() + " : " + (timeNuoi % 60).ToString(); if (timeNuoi > 0) { if (timeleft > 0) { timeleft--; } else { objThoiGian.gameObject.SetActive(false); } show = 2; StartCoroutine(HideAnimal()); } else { show = 1; Img2.sprite = ManagerData.instance.dataVatNuoi.data[idVatNuoi].ThuHoachDe; Img1.gameObject.SetActive(true); foreach (Transform a in transform.GetChild(0)) { GaAnimation anim = a.gameObject.GetComponent <GaAnimation>(); anim.No(); } } }
private void Awake() { instance = this; }