public void Populate(GameObject parent, Bounds bounds, float strength) { parent.AddChildren( (prefabs_per_area * strength).ConvertDensity( bounds.GetFootprintArea(), () => prefab_spawner.SpawnPrefabAt(RandVector3.GetWithinBounds(bounds)) ) ); }
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)); }
protected override void PopulateRegionInternal(float density) { Bounds bounds = GetRegionBounds(); density.ProcessDensity(GetRegionSize(), () => SpawnPrefab(RandVector3.GetWithinBounds(bounds))); }
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)); }