Пример #1
0
    // If attack, rotate > 0, zoomInTime > zoomOutTime
    // If defense, rotate < 0, ZoomInTime < ZoomOutTime
    IEnumerator BattleZoomInRoutine()
    {
        isZooming = true;
        if (cameraEffect != null)
        {
            cameraEffect.EnableCameraBlur(true);
        }

        iTween.ShakePosition(gameObject, iTween.Hash(
                                 "x", shakeRotation,
                                 "time", shakeTime,
                                 "delay", 0.1f
                                 ));

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

        iTween.RotateTo(gameObject, iTween.Hash(
                            "z", rotate,
                            "time", rotateTime,
                            "easetype", zoomInType
                            ));


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

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

        iTween.RotateTo(gameObject, iTween.Hash(
                            "z", 0f,
                            "time", zoomOutTime,
                            "easetype", zoomOutType
                            ));

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


        if (cameraEffect != null)
        {
            cameraEffect.EnableCameraBlur(false);
        }

        isZooming = false;
    }