private void OnMovingBlockTriggerExit(int id)
{
if (id == Id)
{
// If the movement is completed, we need to create a new one in a reversed direction
if (movement.ratioPassed == 1f)
{
movement = LeanTween.moveSpline(gameObject, spline.pts, MovementSpeed / 2).setEase(LeanTweenType.easeInOutQuad).setDirection(-1);
rotation = LeanTween.rotate(gameObject, initialRotation.eulerAngles, MovementSpeed / 2);
}
else
{
movement.setDirection(-1).setTime(MovementSpeed / 2);
rotation.setDirection(-1).setTime(MovementSpeed / 2);
}
}
}