Ejemplo n.º 1
0
 public void Initialize(Unity.Entities.World space)
 {
     characterSpawnSystem = space.GetOrCreateSystem <CharacterSpawnSystem>();
     characterDeathSystem = space.GetOrCreateSystem <CharacterDeathSystem>();
     turretSpawnSystem    = space.GetOrCreateSystem <TurretSpawnerSystem>();
     AddSystemToUpdateList(characterSpawnSystem);
     AddSystemToUpdateList(characterDeathSystem);
     AddSystemToUpdateList(turretSpawnSystem);
     SetLinks();
 }
Ejemplo n.º 2
0
        private void SpawnTurret(Entity e, int turretID)
        {
            CharacterRaycaster caster = World.EntityManager.GetComponentData <CharacterRaycaster>(e);

            if (caster.DidCast() == 1)
            {
                ZoxID stats = World.EntityManager.GetComponentData <ZoxID>(e);
                TurretSpawnerSystem.QueueTurret(caster.voxelPosition, turretID, stats.clanID);
                //caster.triggered = 1;
                //World.EntityManager.SetComponentData(e, caster);
                //Debug.LogError("Spawning Turret at: " + caster.voxelPosition.ToString());
            }
        }