IEnumerator MaintenancePhase() { yield return(new WaitForSeconds(Random.Range(1.5f, 4.9f))); foreach (Beat beat in maintPhase) { reader.InitiateCall(beat.knotname); //PopUp(beat.popUpCount); while (!reader.storyOver) { yield return(new WaitForSeconds(0.1f)); } PopUp(beat.popUpCount); if (beat.hasBlackOut) { breaker.FlipSwitch(); while (!breaker.AreLightsOn()) { yield return(new WaitForSeconds(0.1f)); } } yield return(new WaitForSeconds(beat.waitLength)); } DemoEnd(); }
void Update() { ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out hit)) { if (hit.collider.tag == "Breaker") { if (!tutEnd) { hovertext.enabled = true; } if (Input.GetMouseButtonDown(0)) { tutEnd = true; breaker.FlipSwitch(); } } else if (hit.collider.tag == "Mover") { if (Input.GetMouseButtonDown(0)) { string clipName = hit.collider.name + "_Shimy"; Debug.Log(clipName); hit.collider.gameObject.GetComponent <Animator>().Play(clipName, 0, 0f); } } else { hovertext.enabled = false; } } }