コード例 #1
0
 public SeedGerminationRequirement(PlantSpeciesSeeds speciesSeeds)
 {
     humidityRequirement  = speciesSeeds.humidityRequirement;
     tempetureRequirement = speciesSeeds.tempetureRequirement;
     timeRequirement      = speciesSeeds.timeRequirement;
     timeMaximum          = speciesSeeds.timeMaximum;
 }
コード例 #2
0
ファイル: PlantSpecies.cs プロジェクト: tuvus/iowa-systems
 internal override void SetupSpecificSimulation()
 {
     plantJobController = gameObject.AddComponent <PlantJobController>();
     plantJobController.SetUpJobController(this, earth);
     plantSpeciesSeeds = GetComponent <PlantSpeciesSeeds>();
     plantSpeciesSeeds.SetupPlantSpeciesSeeds();
     growthStages = new NativeArray <GrowthStageData>(growthStagesInput.Count, Allocator.Persistent);
     for (int i = 0; i < growthStagesInput.Count; i++)
     {
         growthStages[i] = new GrowthStageData((PlantScript.GrowthStage)i, growthStagesInput[i].x, growthStagesInput[i].y, growthStagesInput[i].z);
     }
 }
コード例 #3
0
    public int GetAllStartingPlantsAndSeeds()
    {
        int count = 0;

        for (int i = 0; i < transform.childCount; i++)
        {
            PlantSpecies plantSpecies = transform.GetChild(i).GetComponent <PlantSpecies>();
            if (plantSpecies != null)
            {
                count += plantSpecies.startingPopulation;
                PlantSpeciesSeeds speciesSeeds = plantSpecies.GetComponent <PlantSpeciesSeeds>();
                if (speciesSeeds != null)
                {
                    count += speciesSeeds.startingSeedCount;
                }
            }
        }
        return(count);
    }