Example #1
0
    IEnumerator Teleport(Transform checkpoint)
    {
        pw.SetPermitMove(false);
        CameraShake.Instance.ShakeCamera(5f, 0.1f);
        fade.TriggerFade();
        yield return(new WaitForSeconds(timeToFade));

        transform.position = checkpoint.position;
        yield return(new WaitForSeconds(timeToFade));

        fade.TriggerFade();
        pw.SetPermitMove(true);
    }