Exemple #1
0
 // Create shoal of small fish entities around given coordinates
 public static void PopulateSnapshotWithSmallFishGroups(ref Dictionary <EntityId, Entity> snapshotEntities, ref int nextAvailableId)
 {
     foreach (var location in SimulationSettings.FishShoalStartingLocations)
     {
         for (var i = 0; i < SimulationSettings.TotalFishInShoal; i++)
         {
             var nextFishCoodinates = new Vector3(location.x + Random.Range(-SimulationSettings.ShoalRadius, SimulationSettings.ShoalRadius),
                                                  location.y + Random.Range(SimulationSettings.ShoalMinDepth, SimulationSettings.ShoalMaxDepth),
                                                  location.z + Random.Range(-SimulationSettings.ShoalRadius, SimulationSettings.ShoalRadius));
             snapshotEntities.Add(new EntityId(nextAvailableId++), EntityTemplateFactory.GenerateSmallFishTemplate(nextFishCoodinates));
         }
     }
 }