public GameObject Spawn() { if (NextIndices.Count < resolver.Length) { enqueue(); } LastIndex = NextIndices[0]; var obj = Instantiate(resolver.Get(LastIndex), spawnPosition, Quaternion.identity); NextIndices.RemoveAt(0); OnSpawn?.Invoke(this, EventArgs.Empty); return(obj); }
public bool TryGetNextIndex(Guid id, out long value) { return(NextIndices.TryGetValue(id, out value)); }
private void enqueue() { NextIndices.AddRange(indices.Shuffle()); }
public void Clear() { NextIndices.Clear(); }