IEnumerator teachCasting() { KillEm.SetActive(true); current = teachingPhase.Null; looped = true; taps.speed = 0; stylus.GetComponent <SpriteRenderer>().enabled = true; stylus.transform.position = startpos; //target = GameObject.Find("LIghtning 2").transform; taps.Play("Touch", -1, 0); while (stylus.transform.position != ins.transform.GetChild(1).position&& ins != null) { if (ins == null) { break; } stylus.transform.position = Vector3.MoveTowards(stylus.transform.position, ins.transform.GetChild(1).position, 0.04f); yield return(null); } taps.speed = 1; yield return(new WaitUntil(() => ins == null)); stylus.GetComponent <SpriteRenderer>().enabled = false; StartCoroutine(teachPost()); }
IEnumerator teachPost() { KillEm.SetActive(false); Aftermath.SetActive(true); yield return(new WaitUntil(() => Input.GetMouseButtonDown(0))); current = teachingPhase.Done; yield return(null); }