Class BackgroundObjectPlacementRandomizer
Creates multiple layers of evenly distributed but randomly placed objects
Inherited Members
Namespace: UnityEngine.Perception.Randomization.Randomizers
Assembly: Unity.Perception.Runtime.dll
Syntax
[Serializable]
[AddRandomizerMenu("Perception/Background Object Placement Randomizer")]
[MovedFrom("UnityEngine.Perception.Randomization.Randomizers.SampleRandomizers")]
public class BackgroundObjectPlacementRandomizer : Randomizer
Fields
depth
The Z offset component applied to all generated background layers
Declaration
[Tooltip("The Z offset applied to positions of all placed objects.")]
public float depth
Field Value
Type | Description |
---|---|
float |
layerCount
The number of background layers to generate
Declaration
[Tooltip("The number of background layers to generate.")]
public int layerCount
Field Value
Type | Description |
---|---|
int |
placementArea
The 2D size of the generated background layers
Declaration
[Tooltip("The width and height of the area in which objects will be placed. These should be positive numbers and sufficiently large in relation with the Separation Distance specified.")]
public Vector2 placementArea
Field Value
Type | Description |
---|---|
Vector2 |
prefabs
A categorical parameter for sampling random prefabs to place
Declaration
[Tooltip("The list of Prefabs to be placed by this Randomizer.")]
public CategoricalParameter<GameObject> prefabs
Field Value
Type | Description |
---|---|
CategoricalParameter<GameObject> |
separationDistance
The minimum distance between placed background objects
Declaration
[Tooltip("The minimum distance between the centers of the placed objects.")]
public float separationDistance
Field Value
Type | Description |
---|---|
float |
Methods
OnAwake()
OnAwake is called when the Randomizer is added or loaded to a scenario
Declaration
protected override void OnAwake()
Overrides
OnIterationEnd()
Deletes generated background objects after each scenario iteration is complete
Declaration
protected override void OnIterationEnd()
Overrides
OnIterationStart()
Generates background layers of objects at the start of each scenario iteration
Declaration
protected override void OnIterationStart()