public void Next() { for (int i = 0; i < stages.Length; i++) { if (!stages[i].gameObject.activeSelf) { stages[i].gameObject.SetActive(true); if (i > 0) { stages[i - 1].InterruptFade(); } return; } } if (cr_Fade == null) { FadeTo(0); } else { CoroutineManager.HaltCoroutine(ref cr_Fade, this); cg.alpha = 0; OnPhaseDone(); } }
private IEnumerator UpdateDistanceText() { WaitForSeconds wfs = new WaitForSeconds(0.2f); while (true) { yield return(wfs); for (int i = 0; i < PlayerManager.PlayerCount; i++) { Player p = PlayerManager.GetPlayer(i); float distance = p.transform.position.x; distanceTexts[i].text = distance.ToString("F2") + "m"; progressSliders[i].value = distance; if (p.CurrentVelocity == 0.0f && cr_ResetTimers[i] == null) { if (p.CurrentState == Player.PlayerStates.PLAYING) { CoroutineManager.BeginCoroutine(ResetTimer(i), ref cr_ResetTimers[i], this); } } else if (p.CurrentVelocity > 0.0f && cr_ResetTimers[i] != null) { CoroutineManager.HaltCoroutine(ref cr_ResetTimers[i], this); } } } }
public void InterruptFade() { if (doneFading_) { return; } CoroutineManager.HaltCoroutine(ref cr_FadeIn, this); cg.alpha = 1.0f; doneFading_ = true; }
public void ResetText() { CoroutineManager.HaltCoroutine(ref cr_Animation, this); if (startPosition != null) { transform.position = startPosition.position; } else { transform.position = new Vector3(0, 0, transform.position.z); } }