IEnumerator fadeInGameObject(GameObject go) { CanvasGroup cg = go.GetComponent <CanvasGroup>(); float time = 0.5f; while (cg.alpha < 1.0f) { cg.alpha += Time.deltaTime / time; yield return(null); } cg.alpha = 1.0f; crebitosLocker.unlockMenu(); }
IEnumerator fadeOutGameObject(GameObject go) { CanvasGroup cg = go.GetComponent <CanvasGroup>(); float time = 0.5f; while (cg.alpha > 0.0f) { cg.alpha -= Time.deltaTime / time; yield return(null); } cg.alpha = 0.0f; crebitosLocker.unlockMenu(); crebitosScrollText.ResetScrolling(); Debug.Log(crebitosLocker.isLocked()); }
IEnumerator fadeOutGameObject(GameObject go) { // While Crebitos screen is on, titlescreen can not be used go.GetComponent <CanvasGroup>().interactable = false; CanvasGroup cg = go.GetComponent <CanvasGroup>(); float time = 0.5f; while (cg.alpha > 0.0f) { cg.alpha -= Time.deltaTime / time; yield return(null); } cg.alpha = 0.0f; titlescreenLocker.unlockMenu(); }
IEnumerator fadeInGameObject(GameObject go) { CanvasGroup cg = go.GetComponent <CanvasGroup>(); float time = 0.5f; while (cg.alpha < 1.0f) { cg.alpha += Time.deltaTime / time; yield return(null); } cg.alpha = 1.0f; // Once titlescreen is on again, it can be used go.GetComponent <CanvasGroup>().interactable = true; titlescreenLocker.unlockMenu(); }