예제 #1
0
 public static void Dispatch(DispatchPhase phase)
 {
     for (var i = 0; i < 3; i++)
     {
         var singleShot = SingleShotDispatches[(int)phase][i];
         // ReSharper disable once ForCanBeConvertedToForeach
         for (var j = 0; j < singleShot.Count; j++)
         {
             singleShot[j]();
         }
         singleShot.Clear();
         var perFrame = PerFrameDispatches[(int)phase][i];
         // ReSharper disable once ForCanBeConvertedToForeach
         for (var j = 0; j < perFrame.Count; j++)
         {
             perFrame[j]();
         }
     }
 }
예제 #2
0
 public StaticDispatch(DispatchPhase phase)
 {
     Phase = phase;
 }
예제 #3
0
 public static void AddDispatch(DispatchPhase phase, bool perFrame, DispatchOrder order, Action action)
 {
     (perFrame ? SingleShotDispatches : PerFrameDispatches)[(int)phase][(int)order].Add(action);
 }
예제 #4
0
 public static void AddDispatch(DispatchPhase phase, bool perFrame, Action action)
 => AddDispatch(phase, perFrame, DispatchOrder.Normal, action);