Beispiel #1
0
    IEnumerator CameraAnimation()
    {
        while (true)
        {
            if (Time.time - startedTime < CameraAnimationDuration + PauseDuration)
            {
                inst_cam.transform.position = Vector3.Lerp(originCameraPos, CameraSocket.transform.position, ((Time.time - startedTime) / CameraAnimationDuration));
                inst_cam.transform.rotation = Quaternion.Lerp(originCameraRot, CameraSocket.transform.rotation, ((Time.time - startedTime) / CameraAnimationDuration));

                if (Time.time - startedTime > CameraAnimationDuration)
                {
                    cameraEffect.CancelAnimation();
                }
                yield return(new WaitForEndOfFrame());
            }
            else if (Time.time - startedTime < CameraAnimationDuration * 2 + PauseDuration)
            {
                inst_cam.transform.position = Vector3.Lerp(CameraSocket.transform.position, originCameraPos, ((Time.time - startedTime - PauseDuration - CameraAnimationDuration) / CameraAnimationDuration));
                inst_cam.transform.rotation = Quaternion.Lerp(CameraSocket.transform.rotation, originCameraRot, ((Time.time - startedTime - PauseDuration - CameraAnimationDuration) / CameraAnimationDuration));

                yield return(new WaitForEndOfFrame());
            }
            else
            {
                inst_input.AllowInput();
                yield return(null);
            }
        }
    }
Beispiel #2
0
    IEnumerator WaitSomeWhile()
    {
        cameraEffect.StartAnimation();
        yield return(new WaitForSeconds(freezeTime));

        cameraEffect.CancelAnimation();
        particle.Play();
        inst_input.AllowInput();
    }
Beispiel #3
0
 public void CancelCinema()
 {
     cinemaEffect.CancelAnimation();
 }