Exemplo n.º 1
0
Entity* EntityManager::createEntity()
{
    entity_id_type id=generateNewEid();
    Entity* entity=Entity::createWithId(id);
    _entities.push_back(entity);
    return entity;
}
Exemplo n.º 2
0
Entity* ECSManager::createEntity()
{
    entity_id_type id=generateNewEid();
    Entity* entity=Entity::createWithId(id);
    
    //任何时候,新加一个Entity添加到__beAdding数组中
    __beAdding.pushBack(entity);
    return entity;
}