Exemple #1
0
        public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
        {
            var spawnCapsuleData = new SpawnCapsuleData
            {
                SpawnInterval    = SpawnInterval,
                SpawnTimer       = SpawnInterval,
                EntityPrefab     = conversionSystem.GetPrimaryEntity(CapsulePrefab),
                Random           = Unity.Mathematics.Random.CreateFromIndex(0),
                MinSpawnPosition = MinSpawnPosition,
                MaxSpawnPosition = MaxSpawnPosition
            };

            dstManager.AddComponentData(entity, spawnCapsuleData);
        }
Exemple #2
0
 protected override void OnStartRunning()
 {
     _spawnCapsuleData = GetSingleton <SpawnCapsuleData>();
 }