Ejemplo n.º 1
0
 public void Populate(GameObject parent, Bounds bounds, float strength)
 {
     parent.AddChildren(
         (prefabs_per_area * strength).ConvertDensity(
             bounds.GetFootprintArea(),
             () => prefab_spawner.SpawnPrefabAt(RandVector3.GetWithinBounds(bounds))
         )
     );
 }
Ejemplo n.º 2
0
 protected override void ForcePlaceGameObjectOnFloor(GameObject game_object, RaycastHit hit)
 {
     game_object.SetSpacarPosition(hit.point + RandVector3.GetWithinBounds(translation_jitter));
     game_object.SetSpacarRotation(RandVector3.GetWithinBounds(rotation_jitter));
     game_object.SetSpacarScale(RandVector3.GetWithinBounds(scaling_jitter));
 }
Ejemplo n.º 3
0
        protected override void PopulateRegionInternal(float density)
        {
            Bounds bounds = GetRegionBounds();

            density.ProcessDensity(GetRegionSize(), () => SpawnPrefab(RandVector3.GetWithinBounds(bounds)));
        }
Ejemplo n.º 4
0
 public override void ForcePlaceGameObjectAt(GameObject game_object, Vector3 position)
 {
     game_object.SetSpacarPosition(position + RandVector3.GetWithinBounds(translation_jitter));
     game_object.SetSpacarRotation(RandVector3.GetWithinBounds(rotation_jitter));
     game_object.SetSpacarScale(RandVector3.GetWithinBounds(scaling_jitter));
 }