Exemplo n.º 1
0
 private void OnTriggerStay(Collider other)
 {
     if (!exercise.exercisesScriptable.IsParkWithTailer)
     {
         if (other.CompareTag("Player"))
         {
             if (Mathf.RoundToInt(dashboard.Speed) == 0)
             {
                 if (exercise.exercisesScriptable.IsPark)
                 {
                     if (BackCheck(other))
                     {
                         CheckDistance(other);
                     }
                 }
                 else
                 {
                     CheckDistance(other);
                 }
             }
             else
             {
                 if (exercise.exercisesScriptable.IsPark && BackCheck(other))
                 {
                     triggerTask.InvokeTriggerTaskEvent();
                 }
             }
         }
     }
     else
     {
         if (isTrailerFirst)
         {
             if (dashboard != null && Mathf.RoundToInt(dashboard.Speed) == 0)
             {
                 exercise.EndExercise(false);
             }
         }
     }
 }