SceneCounter
namespace Griff.Runtime;
public sealed class SceneCounterCounts a scene (see SceneCounts) a slice of its entities at a time, so a big one is counted over several goes without holding up a frame: 20,000 entities take about 3.6 ms to count at once in a Debug editor.
Methods
Section titled “Methods”public SceneCounts? Count(Scene scene)Counts the next slice of scene’s entities. Returns its counts once a whole pass is done, otherwise null.
A pass goes through the entities there were as it started: one destroyed since isn’t counted, and one spawned since waits for the next pass. Asking about another scene starts again.
Restart
Section titled “Restart”public void Restart(Scene? scene = null)Forgets the pass so far: the next Count starts a fresh one.
Fields
Section titled “Fields”DefaultSlice
Section titled “DefaultSlice”public const int DefaultSliceAbout half a millisecond’s counting in a Debug editor.