private void OnEntitySpawned(EntityID spawned) { if (_entities.Contains(spawned)) { Debug.LogError("Duplicate entity id " + spawned.ObjectID, spawned.gameObject); } else { _entities.Add(spawned); } }
public GameObject GetObject(long id) { EntityID entity = _entities.Find(ent => ent.ObjectID == id); if (entity != null) { return(entity.gameObject); } Debug.LogErrorFormat("Entity with ID {0} not found", id); return(null); }
public bool HasObject(EntityID objectID) { return(_entities.Contains(objectID)); }