IEnumerator LoadSceneSingleCoroutine(string SceneName) { CameraAnimation ca = Camera.main.GetComponent <CameraAnimation>(); CameraControl cc = Camera.main.GetComponent <CameraControl>(); float fotime = 0.7f; ca.FadeOut(fotime); yield return(new WaitForSeconds(fotime)); SceneManager.LoadScene(SceneName, LoadSceneMode.Single); }
IEnumerator StageClearCoroutine() { CameraAnimation ca = Camera.main.GetComponent <CameraAnimation>(); CameraControl cc = Camera.main.GetComponent <CameraControl>(); float waittime = 3; float fotime = 0.7f; yield return(new WaitForSeconds(waittime)); ca.FadeOut(fotime); yield return(new WaitForSeconds(fotime)); }
public IEnumerator StageViewCoroutine() { CameraAnimation ca = Camera.main.GetComponent <CameraAnimation>(); CameraControl cc = Camera.main.GetComponent <CameraControl>(); float x = cc.MaxCameraPosX; float y = cc.MaxCameraPosY; float size = cc.MaxCameraSize; float fitime = 0.5f; float fotime = 0.5f; float mvtime = 3f; ca.FadeIn(fitime); ca.MoveTo(x, y, mvtime); ca.OrthographicSizeTo(size, mvtime); yield return(new WaitForSeconds(mvtime - fitime)); ca.FadeOut(fotime); yield return(new WaitForSeconds(fotime)); cc.SetDefault(); ca.FadeIn(fitime, gameObject, "OnComplete"); }