public override void Execute(float deltaTime)
        {
            float        t       = NormalizedT;
            BezierSpline spline  = Spline;
            bool         forward = MovingForward;

            for (int i = 0; i < tailObjects.Count; i++)
            {
                Transform tailObject = tailObjects[i];

                if (forward)
                {
                    tailObject.position = Vector3.Lerp(tailObject.position, spline.MoveAlongSpline(ref t, -tailObjectDistances[i]), movementLerpModifier * deltaTime);

                    if (lookAt == LookAtMode.Forward)
                    {
                        BezierSpline.PointIndexTuple tuple = spline.GetNearestPointIndicesTo(t);
                        tailObject.rotation = Quaternion.Lerp(tailObject.rotation, Quaternion.LookRotation(tuple.GetTangent(), tuple.GetNormal()), rotationLerpModifier * deltaTime);
                    }
                    else if (lookAt == LookAtMode.SplineExtraData)
                    {
                        tailObject.rotation = Quaternion.Lerp(tailObject.rotation, spline.GetExtraData(t, extraDataLerpAsQuaternionFunction), rotationLerpModifier * deltaTime);
                    }
                }
                else
                {
                    tailObject.position = Vector3.Lerp(tailObject.position, spline.MoveAlongSpline(ref t, tailObjectDistances[i]), movementLerpModifier * deltaTime);

                    if (lookAt == LookAtMode.Forward)
                    {
                        BezierSpline.PointIndexTuple tuple = spline.GetNearestPointIndicesTo(t);
                        tailObject.rotation = Quaternion.Lerp(tailObject.rotation, Quaternion.LookRotation(-tuple.GetTangent(), tuple.GetNormal()), rotationLerpModifier * deltaTime);
                    }
                    else if (lookAt == LookAtMode.SplineExtraData)
                    {
                        tailObject.rotation = Quaternion.Lerp(tailObject.rotation, spline.GetExtraData(t, extraDataLerpAsQuaternionFunction), rotationLerpModifier * deltaTime);
                    }
                }
            }
        }
        public override void Execute(float deltaTime)
        {
            float targetSpeed = (isGoingForward) ? speed : -speed;

            Vector3 targetPos = spline.MoveAlongSpline(ref m_normalizedT, targetSpeed * deltaTime);

            transform.position = targetPos;
            //transform.position = Vector3.Lerp( transform.position, targetPos, movementLerpModifier * deltaTime );

            bool movingForward = MovingForward;

            if (lookAt == LookAtMode.Forward)
            {
                BezierSpline.PointIndexTuple tuple = spline.GetNearestPointIndicesTo(m_normalizedT);
                Quaternion targetRotation;
                if (movingForward)
                {
                    targetRotation = Quaternion.LookRotation(tuple.GetTangent(), tuple.GetNormal());
                }
                else
                {
                    targetRotation = Quaternion.LookRotation(-tuple.GetTangent(), tuple.GetNormal());
                }

                transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, rotationLerpModifier * deltaTime);
            }
            else if (lookAt == LookAtMode.SplineExtraData)
            {
                transform.rotation = Quaternion.Lerp(transform.rotation, spline.GetExtraData(m_normalizedT, extraDataLerpAsQuaternionFunction), rotationLerpModifier * deltaTime);
            }

            if (movingForward)
            {
                if (m_normalizedT >= 1f)
                {
                    if (travelMode == TravelMode.Once)
                    {
                        m_normalizedT = 1f;
                    }
                    else if (travelMode == TravelMode.Loop)
                    {
                        m_normalizedT -= 1f;
                    }
                    else
                    {
                        m_normalizedT  = 2f - m_normalizedT;
                        isGoingForward = !isGoingForward;
                    }

                    if (!onPathCompletedCalledAt1)
                    {
                        onPathCompletedCalledAt1 = true;
#if UNITY_EDITOR
                        if (UnityEditor.EditorApplication.isPlaying)
#endif
                        onPathCompleted.Invoke();
                    }
                }
                else
                {
                    onPathCompletedCalledAt1 = false;
                }
            }
            else
            {
                if (m_normalizedT <= 0f)
                {
                    if (travelMode == TravelMode.Once)
                    {
                        m_normalizedT = 0f;
                    }
                    else if (travelMode == TravelMode.Loop)
                    {
                        m_normalizedT += 1f;
                    }
                    else
                    {
                        m_normalizedT  = -m_normalizedT;
                        isGoingForward = !isGoingForward;
                    }

                    if (!onPathCompletedCalledAt0)
                    {
                        onPathCompletedCalledAt0 = true;
#if UNITY_EDITOR
                        if (UnityEditor.EditorApplication.isPlaying)
#endif
                        onPathCompleted.Invoke();
                    }
                }
                else
                {
                    onPathCompletedCalledAt0 = false;
                }
            }
        }
    /// <summary>
    /// Update lorsque la spline suivi est un cercle, permet de check les conditions de sortie
    /// </summary>
    void PathUpdateCircle()
    {
        //Si le cercle actuel ne correspond pas au cercle voulue
        if (curCircleIndex != newCircleIndex && curSpline != null)
        {
            int   nextIndex;                                                        //Correspondra à l'index de la line de sortie
            float dist;                                                             //Correspondra à la distance entre le flock et l'intersection de sortie

            BezierSolution.BezierSpline.PointIndexTuple indexTuple;                 //variable qui stock l'index des intersections suivante et précedente sur la spline

            indexTuple = curSpline.GetNearestPointIndicesTo(SC_bezier.NormalizedT); //Récupère les index en fonction de la position actuel du flock


            //Si le Flock est en mode attaque et que le Path Preference est Line
            if (isAttacking)
            {
                //L'index de sortie est l'index correspondant a la line sur lequel le path d'attaque est situé
                nextIndex = newLineIndex;
            }
            //Sinon
            else if (SC_bezier.MovingForward)
            {
                //Si le flock est en rotation Horraire recupère l'index d'interessection suivant
                nextIndex = indexTuple.index2;
            }
            else
            {
                //Sinon récupère le précédent
                nextIndex = indexTuple.index1;
            }

            //Calcul la distance actuel entre le flock et l'intersection
            if (_IntersectionTab[curCircleIndex, nextIndex] != null)
            {
                dist = Vector3.Distance(_IntersectionTab[curCircleIndex, nextIndex].position, transform.position);
            }
            else
            {
                dist = 10000;
            }


            //Si la distance en inférieure a la distance minimale requise
            if (dist < DistanceChangeSpline)
            {
                //Change vers la spline Line et se déplace vers le prochain cercle
                if (curCircleIndex > newCircleIndex)
                {
                    SC_bezier.MovingForward = false;
                }
                else
                {
                    SC_bezier.MovingForward = true;
                }

                GetOnLineSpline(nextIndex);
            }
        }

        /*
         * //Si le flock doit aller sur une spline d'attaque et qu'il est sur le bon index de cercle où ce situe l'entrée de la spline
         * else if(isAttacking)
         * {
         *  //check les distance entre le flock et le point d'entrée de la spline
         *  float dist;
         *  dist = Vector3.Distance(_IntersectionTab[curCircleIndex, newLineIndex].position, transform.position);
         *
         *
         *  //Si la distance en inférieure a la distance minimale requise
         *  if (dist < DistanceChangeSpline)
         *  {
         *      //Change de spline pour passer sur la spline Attaque
         *      SC_bezier.MovingForward = true;
         *      GetOnAttackSpline(newAttackPathIndex);
         *  }
         * }*/
    }