Exemplo n.º 1
0
    void LateUpdate()
    {
        if (position != old_position)
        {
            old_position = position;
            ApplyPosition();
        }

        if (angle != old_angle)
        {
            if (lerpRotation)
            {
                lerpRotationTimes = 0;
                startRotation     = transform_u3d.rotation;
                targetRotation    = Quaternion.Euler(0, FixMath.AngleToDegree(angle), 0);
            }
            else
            {
                transform_u3d.rotation = Quaternion.Euler(0, FixMath.AngleToDegree(angle), 0);
            }
            old_angle = angle;
        }

        if (scale != old_scale)
        {
            old_scale = scale;
            ApplyScale();
        }

        // lerp
        LerpRotation();
    }