private void ShowCredits() { button.interactable = false; CoroutinesHandler.Get().RunCoroutineWithCheck(ref moveOutOfScreenCoroutine, MoveOutOfScreen()); text.text = creditText; isShown = true; }
void Start() { Application.runInBackground = true; source.Play(); CoroutinesHandler.Get().RunCoroutineWithCheck(ref spawnCloudsCoroutine, SpawnClouds()); }
private void HideCredits() { button.interactable = true; CoroutinesHandler.Get().KillCoroutine(moveOutOfScreenCoroutine); button.transform.position = zeroPosition; text.text = ""; isShown = false; }
private void OnDisable() { CoroutinesHandler coroutinesHandler = CoroutinesHandler.Get(); if (coroutinesHandler != null) { coroutinesHandler.KillCoroutine(moveOutOfScreenCoroutine); } }
private void OnDisable() { isShuttingDown = true; CoroutinesHandler coroutinesHandler = CoroutinesHandler.Get(); if (coroutinesHandler != null) { coroutinesHandler.KillCoroutine(cloudMovingCoroutine); } }
private IEnumerator MoveOutOfScreen() { yield return(null); button.transform.position -= moveVector; if (button.transform.position.y > positionWhenCredits.y) { CoroutinesHandler.Get().RunCoroutineWithCheck(ref moveOutOfScreenCoroutine, MoveOutOfScreen()); } }
public void FadeOut() { button1.interactable = false; button2.interactable = false; CoroutinesHandler.Get().KillCoroutine(fadeInCoroutine); if (fadeOutCoroutine != null) { return; } CoroutinesHandler.Get().RunCoroutine(fadeOutCoroutine, DoFadeOut()); }
private void OnDisable() { Coroutine[] coroutinesToKill = { fadeInCoroutine, fadeOutCoroutine }; CoroutinesHandler coroutinesHandler = CoroutinesHandler.Get(); if (coroutinesHandler != null) { coroutinesHandler.KillGivenCoroutines(coroutinesToKill); } }
private IEnumerator MoveClouds() { yield return(null); if (!isShuttingDown) { for (int i = 0; i < clouds.Count; i++) { if (i == 2 || i == 3) { clouds[i].transform.position += fastCloud; } else { clouds[i].transform.position += slowCloud; } } CoroutinesHandler.Get().RunCoroutineWithCheck(ref cloudMovingCoroutine, MoveClouds()); } }
private IEnumerator CheckHour() { currentTime = System.DateTime.Now.Hour; if (currentTime >= 8 && currentTime < 16) { meshRenderer.material.SetTexture("_MainTex", onDay); } else if (currentTime >= 16 && currentTime < 22) { meshRenderer.material.SetTexture("_MainTex", onEvening); } else { meshRenderer.material.SetTexture("_MainTex", onNight); } yield return(new WaitForSecondsRealtime(refreshTimeCheckingInterval)); CoroutinesHandler.Get().RunCoroutineWithCheck(ref checkTimeCoroutine, CheckHour()); }
public static CoroutinesHandler Get() { if (isShutingDown) { return(null); } lock (_lock) { if (instance == null) { instance = (CoroutinesHandler)FindObjectOfType(typeof(CoroutinesHandler)); if (instance == null) { GameObject newGameObject = new GameObject(typeof(CoroutinesHandler).ToString()); instance = newGameObject.AddComponent <CoroutinesHandler>(); DontDestroyOnLoad(newGameObject); } } return(instance); } }
void Start() { CoroutinesHandler.Get().RunCoroutineWithCheck(ref fadeInCoroutine, DoFadeIn()); }
private void Start() { CoroutinesHandler.Get().RunCoroutineWithCheck(ref cloudMovingCoroutine, MoveClouds()); }
private void Start() { CoroutinesHandler.Get().RunCoroutineWithCheck(ref checkTimeCoroutine, CheckHour()); }