Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 public bool TryGetNextIndex(Guid id, out long value)
 {
     return(NextIndices.TryGetValue(id, out value));
 }
Esempio n. 3
0
 private void enqueue()
 {
     NextIndices.AddRange(indices.Shuffle());
 }
Esempio n. 4
0
 public void Clear()
 {
     NextIndices.Clear();
 }