예제 #1
0
파일: SmoothLerp.cs 프로젝트: 0rnj/Examples
    // Color lerp
    public void Lerp(Color start, Color end, float speed = 1f, AnimationCurve curve = null)
    {
        LerpingType = LerpingObject.Color;
        StartColor  = start;
        EndColor    = end;
        Speed       = speed;
        if (curve != null)
        {
            Curve = curve;
        }

        Lerp();
    }
예제 #2
0
파일: SmoothLerp.cs 프로젝트: 0rnj/Examples
    // Position or Scale lerp
    public void Lerp(Vector3 start, Vector3 end, float speed = 1f, bool isTransformLerp = true, AnimationCurve curve = null)
    {
        if (isTransformLerp)
        {
            LerpingType   = LerpingObject.Transform;
            StartPosition = start;
            EndPosition   = end;
        }
        else
        {
            LerpingType = LerpingObject.Scale;
            StartScale  = start;
            EndScale    = end;
        }
        Speed = speed;
        if (curve != null)
        {
            Curve = curve;
        }

        Lerp();
    }