IEnumerator LoadSceneAsync(string sceneName) { DontDestroyOnLoad(transform.root.gameObject); async = SceneManager.LoadSceneAsync(sceneName); async.allowSceneActivation = false; yield return(new WaitForSecondsRealtime(1.5f)); async.allowSceneActivation = true; while (!async.isDone) { yield return(null); } loadingPanelTween.OpenCloseObjectAnimation(); Time.timeScale = 1f; Destroy(loadingPanelTween.transform.root.gameObject, loadingPanelTween.GetAnimationDuration() * 2.0f); }
private IEnumerator IEStartGame() { int readyCount = 3; while (readyCount > 0) { if (readyCount == 3) { yield return(new WaitForSeconds(0.3f)); } readyCountTween.ResetStartAction(); readyCount--; SetReadyCount(readyCount, true); yield return(new WaitForSeconds(readyCountTween.GetAnimationDuration() + 0.1f)); } SetReadyCount(0, false); InvokeNextQuiz(); }
IEnumerator AnimateUnlock(Text Titletext, Text DescriptionText, string finalTitleText, string finalDescriptionText, string preTitleDeco, string postTitleDeco) { EasyTweenTropheeOpenClose.OpenCloseObjectAnimation(); Titletext.text = preDeco + postDeco; DescriptionText.text = ""; yield return(new WaitForSecondsRealtime(EasyTweenTropheeOpenClose.GetAnimationDuration() * 2.0f)); int numberOfAdds = 0; while (numberOfAdds < finalTitleText.Length) { Titletext.text = preDeco + finalTitleText.Substring(0, ++numberOfAdds) + postDeco; yield return(new WaitForSecondsRealtime(Random.Range(0.2f, 2.0f) * timeTapping)); } numberOfAdds = 0; while (numberOfAdds < finalDescriptionText.Length) { DescriptionText.text = finalDescriptionText.Substring(0, ++numberOfAdds); yield return(new WaitForSecondsRealtime(Random.Range(0.2f, 2.0f) * timeTapping)); } yield return(new WaitForSecondsRealtime(timeWaiting)); EasyTweenTropheeOpenClose.OpenCloseObjectAnimation(); }
// Use this for initialization void Start () { et = GetComponent<EasyTween>(); ResetTime = et.GetAnimationDuration(); }