コード例 #1
0
 private void OnEntitySpawned(EntityID spawned)
 {
     if (_entities.Contains(spawned))
     {
         Debug.LogError("Duplicate entity id " + spawned.ObjectID, spawned.gameObject);
     }
     else
     {
         _entities.Add(spawned);
     }
 }
コード例 #2
0
        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);
        }
コード例 #3
0
 public bool HasObject(EntityID objectID)
 {
     return(_entities.Contains(objectID));
 }