public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem) { var spawnerData = new SpawnerGardenEntity { prefabEarth = conversionSystem.GetPrimaryEntity(prefabEarth), prefabFollowJuice = conversionSystem.GetPrimaryEntity(prefabFollowJuice), }; dstManager.AddComponentData(entity, spawnerData); }
protected override JobHandle OnUpdate(JobHandle inputDependencies) { if (currentCooldown <= 0) { currentCooldown = Root.SimulationTick; NativeArray <SpawnerGardenEntity> spawnerArray = spawnerQuery.ToComponentDataArray <SpawnerGardenEntity>(Allocator.TempJob); spawner = spawnerArray[0]; spawnerArray.Dispose(); JobHandle compoundJobHandle = DelayedUpdate(inputDependencies); return(compoundJobHandle); } else { currentCooldown -= UnityEngine.Time.deltaTime; return(inputDependencies); } }