public static void RegisterCallback(UnityAction callback) { int updateOrder = BeforeRenderHelper.GetUpdateOrder(callback); object obj = BeforeRenderHelper.s_OrderBlocks; lock (obj) { int num = 0; while (num < BeforeRenderHelper.s_OrderBlocks.Count && BeforeRenderHelper.s_OrderBlocks[num].order <= updateOrder) { if (BeforeRenderHelper.s_OrderBlocks[num].order == updateOrder) { BeforeRenderHelper.OrderBlock value = BeforeRenderHelper.s_OrderBlocks[num]; value.callback = (UnityAction)Delegate.Combine(value.callback, callback); BeforeRenderHelper.s_OrderBlocks[num] = value; return; } num++; } BeforeRenderHelper.OrderBlock item = default(BeforeRenderHelper.OrderBlock); item.order = updateOrder; item.callback = (UnityAction)Delegate.Combine(item.callback, callback); BeforeRenderHelper.s_OrderBlocks.Insert(num, item); } }
public static void UnregisterCallback(UnityAction callback) { int updateOrder = BeforeRenderHelper.GetUpdateOrder(callback); object obj = BeforeRenderHelper.s_OrderBlocks; lock (obj) { int num = 0; while (num < BeforeRenderHelper.s_OrderBlocks.Count && BeforeRenderHelper.s_OrderBlocks[num].order <= updateOrder) { if (BeforeRenderHelper.s_OrderBlocks[num].order == updateOrder) { BeforeRenderHelper.OrderBlock value = BeforeRenderHelper.s_OrderBlocks[num]; value.callback = (UnityAction)Delegate.Remove(value.callback, callback); BeforeRenderHelper.s_OrderBlocks[num] = value; if (value.callback == null) { BeforeRenderHelper.s_OrderBlocks.RemoveAt(num); } break; } num++; } } }
public static void UnregisterCallback(UnityAction callback) { int updateOrder = BeforeRenderHelper.GetUpdateOrder(callback); List <BeforeRenderHelper.OrderBlock> obj = BeforeRenderHelper.s_OrderBlocks; lock (obj) { int num = 0; while (num < BeforeRenderHelper.s_OrderBlocks.Count && BeforeRenderHelper.s_OrderBlocks[num].order <= updateOrder) { bool flag = BeforeRenderHelper.s_OrderBlocks[num].order == updateOrder; if (flag) { BeforeRenderHelper.OrderBlock orderBlock = BeforeRenderHelper.s_OrderBlocks[num]; orderBlock.callback = (UnityAction)Delegate.Remove(orderBlock.callback, callback); BeforeRenderHelper.s_OrderBlocks[num] = orderBlock; bool flag2 = orderBlock.callback == null; if (flag2) { BeforeRenderHelper.s_OrderBlocks.RemoveAt(num); } break; } num++; } } }
internal static void InvokeOnBeforeRender() { BeforeRenderHelper.Invoke(); }