コード例 #1
0
 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);
 }
コード例 #2
0
ファイル: PlantUpdateJob.cs プロジェクト: tuvus/iowa-systems
    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));
    }