Exemplo n.º 1
0
    public void ZoomTo(Vector3 pos, bool isLocal)
    {
        float duration = .2f;

        if (zoom != null)
        {
            StopCoroutine(zoom);
        }

        zoom = isLocal ? StartCoroutine(Interpolater.InterpolateLocalTransform(camControl.offset, pos, duration))
            : StartCoroutine(Interpolater.InterpolateGlobalTransform(camControl.offset, pos, duration));
    }
Exemplo n.º 2
0
    public void ZoomTo(Vector3 pos, Vector3 targetPos)
    {
        float duration = .2f;

        if (zoom != null)
        {
            StopCoroutine(zoom);
        }
        if (shiftFocus != null)
        {
            StopCoroutine(shiftFocus);
        }
        if (resetRot != null)
        {
            StopCoroutine(resetRot);
        }

        zoom       = StartCoroutine(Interpolater.InterpolateLocalTransform(camControl.offset, pos, duration));
        shiftFocus = StartCoroutine(Interpolater.InterpolateLocalTransform(camControl.focusTarget, targetPos, duration));
        resetRot   = StartCoroutine(Interpolater.InterpolateLocalRotation(camControl.turn, Quaternion.Euler(Vector3.zero), duration));
    }