
This is a tad bit overkill but yeah, just wondering.
That may not work for objects with timers running on them.Wolfy wrote:For updates, you can used a 'touch' based system, which in worst case is still O(N), but more likely will be much less than that.
Take a queue or a stack, your pick
If anything happens to an object, (such as a collision is detected, or a script is called on it) then put it in the queue/stack. At the end, when everything needs to be updated, iterate though only these objects and update them, instead of updating everything.
Of course, depending on how the system is implemented and what the updates are doing, it could be a bit more complex than that, but it should greatly improve performance because in most cases, its just iterating through things that do nothing.