Esempio n. 1
0
        /// <summary>
        /// Tries to remove a component from the group. ONLY Invoke from the component's OnDisable callback, or by setting
        /// the update config flags (either via code or toggling from the Inspector).
        /// Does nothing if the component is not already registered with the group.
        /// </summary>
        /// <param name="component">The component to try removing from this group's lists.</param>
        public void TryUnregister(ManagedUpdatesBehaviour component)
        {
            // TODO: Miscreant: For a "strict" mode, should check to make sure this is actually the given component's execution group.

            // TODO: Miscreant: avoid calling properties here, just pass the registration flags in as parameters as a micro-optimization.
            if (!component.ShouldUpdate)
            {
                _updateList.Remove(component);
            }
            if (!component.ShouldFixedUpdate)
            {
                _fixedUpdateList.Remove(component);
            }
        }
        public void Traverse(Action <ManagedUpdatesBehaviour> perElementAction)
        {
            if (count == 0)
            {
                return;
            }

            current = head;
            do
            {
                perElementAction.Invoke(current);
                Advance();
            } while (!ReferenceEquals(current, head));
            current = null;
        }
        public void ExecuteAll()
        {
            if (count == 0)
            {
                return;
            }

            current = head;
            do
            {
                ExecuteCurrent();
                Advance();
            } while (!ReferenceEquals(current, head));
            current = null;
        }
 internal abstract void Remove(ManagedUpdatesBehaviour component);
 internal abstract void AddToTail(ManagedUpdatesBehaviour component);