public override JobHandle StartUpdateJob() { SetUpdateNativeArrays(); job = PlantUpdateJob.BeginJob(plantReasourceGain, plantGrowthStage, updatePlants, plantSpecies.GetActivePlantCount(), earth.GetZoneController().allPlants, earth.GetZoneController().zones, earth.GetZoneController().neiboringZones, earth.GetZoneController().plantsInZones, earth.earthState, plantSpecies.growthStages, plantSpecies.GetSpeciesSeeds().seedGerminationRequirement); return(job); }
public static JobHandle BeginJob(NativeArray <float2> plantReasourceGain, NativeArray <PlantScript.GrowthStage> plantGrowthStage, NativeArray <int> plants, int plantCount, NativeArray <PlantScript.PlantData> allPlants, NativeArray <ZoneController.ZoneData> zones, NativeMultiHashMap <int, int> neiboringZones, NativeMultiHashMap <int, int> plantsInZones, EarthScript.EarthState earthState, NativeArray <PlantSpecies.GrowthStageData> growthStages, PlantSpeciesSeeds.SeedGerminationRequirement seedGerminationRequirement) { PlantUpdateJob job = new PlantUpdateJob { plantReasourceGain = plantReasourceGain, plantGrowthStage = plantGrowthStage, updatePlants = plants, allPlants = allPlants, zones = zones, neiboringZones = neiboringZones, plantsInZones = plantsInZones, earthState = earthState, growthStages = growthStages, seedGerminationRequirement = seedGerminationRequirement, }; return(IJobParallelForExtensions.Schedule(job, plantCount, 1)); }