示例#1
0
        public static void UnregisterFixedUpdate(IAsyncBehaviour b)
        {
            int count = fixedUpdates.Count;
            int i     = b.fixedUpdateIndex;

            if (count > 1)
            {
                var toSwap = fixedUpdates[count - 1];
                fixedUpdates[i]         = toSwap;
                toSwap.fixedUpdateIndex = i;
                fixedUpdates.RemoveAt(count - 1);
            }
            else
            {
                fixedUpdates.RemoveAt(i);
            }
        }
示例#2
0
 public BehaviourTask(IAsyncBehaviour behaviour)
 {
     this.behaviour = behaviour;
 }
示例#3
0
 public static void RegisterLateUpdate(IAsyncBehaviour b)
 {
     b.lateUpdateIndex = lateUpdates.Count;
     lateUpdates.Add(b);
 }
示例#4
0
 public static void RegisterFixedUpdate(IAsyncBehaviour b)
 {
     b.fixedUpdateIndex = fixedUpdates.Count;
     fixedUpdates.Add(b);
 }
示例#5
0
 public static void RegisterUpdate(IAsyncBehaviour b)
 {
     b.updateIndex = updates.Count;
     updates.Add(b);
 }