void OnTriggerExit2D(Collider2D other) { if (other.name == "Astronauta") { mytotem = TotemStatus.ToFix; } }
void Start() { mytotem = TotemStatus.ToFix; if(ui == null) { ui = FindObjectOfType<UIManager>(); } anim = GetComponent<Animator>(); }
private IEnumerator FixTheTotem(float waitTime) { mytotem = TotemStatus.FixingTotem; ui.SetTotem(this); while (totemPercent < 100 && mytotem == TotemStatus.FixingTotem) { yield return new WaitForSeconds(waitTime); gameObject.GetComponent<Totem>().totemPercent += 1; print(gameObject.GetComponent<Totem>().totemPercent); } if (totemPercent >= 100) { mytotem = TotemStatus.FixedTotem; StartCoroutine(WaitAndInstantiate(5.0f)); } }