static GWorld() { world = new WorldStates(); patients = new Queue <GameObject>(); cubicles = new Queue <GameObject>(); GameObject[] cubes = GameObject.FindGameObjectsWithTag("Cubicle"); foreach (GameObject c in cubes) { cubicles.Enqueue(c); } if (cubes.Length > 0) { world.ModifyState("FreeCubicle", cubes.Length); } }
public ResourceQueue(string tag, string stateName, WorldStates worldStates) { _tag = tag; _state = stateName; if (_tag != "") { GameObject[] resources = GameObject.FindGameObjectsWithTag(_tag); foreach (GameObject gameObject in resources) { _queue.Enqueue(gameObject); } } if (_state != "") { worldStates.ModifyState(_state, _queue.Count); } }