IEnumerator FadeInUI() { yield return(new WaitForSeconds(mTimeToReachDestination)); mEndGameScreen.SetActive(true); mGameObjectToFadeOut.SetActive(false); /*Image endGameImage = mEndGameScreen.GetComponent<Image>(); * mGameObjectToFadeOut.SetActive(false); * * Color tempColor = endGameImage.color; * tempColor.a = 0f; * * endGameImage.color = tempColor; * //Debug.Log(mEndGameScreen.GetComponent<Image>().color.a); * mEndGameScreen.SetActive(true); * * float time = 0.0f; * float percentageOfTimeCompleted = 1f; * float step = percentageOfTimeCompleted; * * while (time <= mTimeToReachDestination) { * * time += Time.deltaTime; * percentageOfTimeCompleted = (1f - time / mTimeToReachDestination); * step = Lineartransformations.SmoothStart2(percentageOfTimeCompleted); * * tempColor.a = Mathf.Lerp(255f, 0f, step); * endGameImage.color = tempColor; * * yield return new WaitForSeconds(Time.deltaTime); * } */ //This is not clean but it works mMenuSelectionManger.SetNewActiveMenu(mEndGameScreen.transform.parent.gameObject.GetComponent <XBoxSelectionMenu>()); }
private void EndCountDown() { mMenuManager.SetNewActiveMenu(mNextMenu); this.gameObject.SetActive(false); }