Exemplo n.º 1
0
    private IEnumerator DrawAnimation(float drawTime)
    {
        currentDrawDelay   = drawTime;
        animationIsPlaying = true;
        switchRot          = new Vector3(drawRot.x, -drawRot.y, drawRot.z);
        switchWepRotTarget = 22f;
        drawOffset         = -0.005f;
        drawTilt           = 0f;
        dTiltTarg          = 16f;

        pl.CameraDrawAnimation(drawTime * 1.45f);

        float coolDown = 0f;

        while (coolDown < currentDrawDelay)
        {
            coolDown += Time.deltaTime;
            yield return(null);
        }

        drawTilt           = 16f;
        dTiltTarg          = 0f;
        switchRot          = Vector3.zero;
        drawOffset         = 0f;
        switchWepRot       = 14f;
        switchWepRotTarget = 0f;
        currentDrawDelay   = 0f;
        yield return(new WaitForSeconds(0.3f));

        animationIsPlaying = false;
    }