iTween.ApplyPunchRotationTargets C# (CSharp) Method

ApplyPunchRotationTargets() private method

private ApplyPunchRotationTargets ( ) : void
return void
    void ApplyPunchRotationTargets()
    {
        preUpdate = transform.eulerAngles;

        //calculate:
        if(vector3s[1].x>0){
            vector3s[2].x = punch(vector3s[1].x,percentage);
        }else if(vector3s[1].x<0){
            vector3s[2].x=-punch(Mathf.Abs(vector3s[1].x),percentage);
        }
        if(vector3s[1].y>0){
            vector3s[2].y=punch(vector3s[1].y,percentage);
        }else if(vector3s[1].y<0){
            vector3s[2].y=-punch(Mathf.Abs(vector3s[1].y),percentage);
        }
        if(vector3s[1].z>0){
            vector3s[2].z=punch(vector3s[1].z,percentage);
        }else if(vector3s[1].z<0){
            vector3s[2].z=-punch(Mathf.Abs(vector3s[1].z),percentage);
        }

        //apply:
        transform.Rotate(vector3s[2]-vector3s[3],space);

        //record:
        vector3s[3]=vector3s[2];

        //dial in:
        /*
        if(percentage==1){
            transform.eulerAngles=vector3s[0];
        }
        */

        //need physics?
        postUpdate=transform.eulerAngles;
        if(physics){
            transform.eulerAngles=preUpdate;
            rigidbody.MoveRotation(Quaternion.Euler(postUpdate));
        }
    }
iTween