Example #1
0
    Entity CreateNewSector(int3 sectorWorldPos)
    {
        Entity newSectorEntity = entityManager.CreateEntity(sectorEntityArchetype);

        entityManager.SetComponentData(newSectorEntity, new Translation {
            Value = sectorWorldPos
        });
        entityManager.SetComponentData(newSectorEntity, new Sector {
            entity = newSectorEntity, worldPosition = sectorWorldPos
        });
        sectorMatrix.AddItem(newSectorEntity, sectorWorldPos);
        return(newSectorEntity);
    }