Пример #1
0
    IEnumerator AfflictionZoomRoutine(string action)
    {
        isZooming = true;
        if (cameraEffect != null)
        {
            if (action == "Affliction")
            {
                cameraEffect.EnableRedCameraBlur(true);
            }
            else if (action == "Virtue")
            {
                cameraEffect.EnableLightCameraBlur(true);
            }
        }

        iTween.ValueTo(gameObject, iTween.Hash(
                           "from", normalRate,
                           "to", mentalZoomRate,
                           "time", zoomInTime,
                           "delay", zoomInDelay,
                           "easetype", zoomInType,
                           "unupdatetarget", gameObject,
                           "onupdate", "UpdateZoom"
                           ));

        yield return(new WaitForSeconds(zoomInTime + zoomInDelay + mentalZoomStay));

        iTween.ValueTo(gameObject, iTween.Hash(
                           "from", mentalZoomRate,
                           "to", normalRate,
                           "time", zoomOutTime,
                           "delay", zoomOutDelay,
                           "easetype", zoomOutType,
                           "unupdatetarget", gameObject,
                           "onupdate", "UpdateZoom"
                           ));

        yield return(new WaitForSeconds(zoomOutTime + zoomOutDelay));

        if (cameraEffect != null)
        {
            if (action == "Affliction")
            {
                cameraEffect.EnableRedCameraBlur(false);
            }
            else if (action == "Virtue")
            {
                cameraEffect.EnableLightCameraBlur(false);
            }
        }

        isZooming = false;
    }