Class ForegroundObjectPlacementRandomizer
Creates a 2D layer of of evenly spaced GameObjects from a given list of prefabs
Inherited Members
Namespace: UnityEngine.Perception.Randomization.Randomizers
Assembly: Unity.Perception.Runtime.dll
Syntax
[Serializable]
[AddRandomizerMenu("Perception/Foreground Object Placement Randomizer")]
[MovedFrom("UnityEngine.Perception.Randomization.Randomizers.SampleRandomizers")]
public class ForegroundObjectPlacementRandomizer : Randomizer
Fields
depth
The Z offset component applied to the generated layer of GameObjects
Declaration
[Tooltip("The Z offset applied to positions of all placed objects.")]
public float depth
Field Value
Type | Description |
---|---|
float |
placementArea
The size of the 2D area designated for object placement
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
The list of prefabs sample and randomly 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 all placed 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 foreground objects after each scenario iteration is complete
Declaration
protected override void OnIterationEnd()
Overrides
OnIterationStart()
Generates a foreground layer of objects at the start of each scenario iteration
Declaration
protected override void OnIterationStart()