void OnDrawGizmos()
        {
            Transform[] trans = GetTransforms();
            if (trans.Length < 2)
            {
                return;
            }

            SplineInterpolator interp = GetComponent(typeof(SplineInterpolator)) as SplineInterpolator;

            SetupSplineInterpolator(interp, trans);
            interp.StartInterpolation(null, false, WrapMode);


            Vector3 prevPos = trans[0].position;

            for (int c = 1; c <= 100; c++)
            {
                float   currTime = c * Duration / 100;
                Vector3 currPos  = interp.GetHermiteAtTime(currTime);
                float   mag      = (currPos - prevPos).magnitude * 2;
                Gizmos.color = new Color(mag, 0, 0, 1);
                Gizmos.DrawLine(prevPos, currPos);
                prevPos = currPos;
            }
        }
        void Start()
        {
            mSplineInterp = GetComponent(typeof(SplineInterpolator)) as SplineInterpolator;

            mTransforms = GetTransforms();

            if (HideOnExecute)
            {
                DisableTransforms();
            }

            if (AutoStart)
            {
                FollowSpline();
            }
        }
        void SetupSplineInterpolator(SplineInterpolator interp, Transform[] trans)
        {
            interp.Reset();

            float step = (AutoClose) ? Duration / trans.Length :
                         Duration / (trans.Length - 1);

            int c;

            for (c = 0; c < trans.Length; c++)
            {
                if (OrientationMode == eOrientationMode.NODE)
                {
                    interp.AddPoint(trans[c].position, trans[c].rotation, step * c, new Vector2(0, 1), trans[c].localScale);
                }
                else if (OrientationMode == eOrientationMode.TANGENT)
                {
                    Quaternion rot;
                    if (c != trans.Length - 1)
                    {
                        rot = Quaternion.LookRotation(trans[c + 1].position - trans[c].position, trans[c].up);
                    }
                    else if (AutoClose)
                    {
                        rot = Quaternion.LookRotation(trans[0].position - trans[c].position, trans[c].up);
                    }
                    else
                    {
                        rot = trans[c].rotation;
                    }

                    interp.AddPoint(trans[c].position, rot, step * c, new Vector2(0, 1), trans[c].localScale);
                }
            }

            if (AutoClose)
            {
                interp.SetAutoCloseMode(step * c);
            }
        }
        void Start()
        {
            mSplineInterp = GetComponent(typeof(SplineInterpolator)) as SplineInterpolator;

            mTransforms = GetTransforms();

            if (HideOnExecute)
            DisableTransforms();

            if (AutoStart)
            FollowSpline();
        }
        void SetupSplineInterpolator(SplineInterpolator interp, Transform[] trans)
        {
            interp.Reset();

            float step = (AutoClose) ? Duration / trans.Length :
            Duration / (trans.Length - 1);

            int c;
            for (c = 0; c < trans.Length; c++)
            {
            if (OrientationMode == eOrientationMode.NODE)
            {
                interp.AddPoint(trans[c].position, trans[c].rotation, step * c, new Vector2(0, 1),trans[c].localScale);
            }
            else if (OrientationMode == eOrientationMode.TANGENT)
            {
                Quaternion rot;
                if (c != trans.Length - 1)
                    rot = Quaternion.LookRotation(trans[c + 1].position - trans[c].position, trans[c].up);
                else if (AutoClose)
                    rot = Quaternion.LookRotation(trans[0].position - trans[c].position, trans[c].up);
                else
                    rot = trans[c].rotation;

                interp.AddPoint(trans[c].position, rot, step * c, new Vector2(0, 1),trans[c].localScale);
            }
            }

            if (AutoClose)
            interp.SetAutoCloseMode(step * c);
        }