docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class BackgroundObjectPlacementRandomizer

    Creates multiple layers of evenly distributed but randomly placed objects

    Inheritance
    object
    Randomizer
    BackgroundObjectPlacementRandomizer
    Inherited Members
    Randomizer.enabled
    Randomizer.enabledStateCanBeSwitchedByUser
    Randomizer.scenario
    Randomizer.tagManager
    Randomizer.Query<T>()
    Randomizer.OnCreate()
    Randomizer.OnEnable()
    Randomizer.OnDisable()
    Randomizer.OnScenarioStart()
    Randomizer.OnScenarioComplete()
    Randomizer.OnStartRunning()
    Randomizer.OnStopRunning()
    Randomizer.OnUpdate()
    Randomizer.OnDestroy()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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
    Randomizer.OnAwake()

    OnIterationEnd()

    Deletes generated background objects after each scenario iteration is complete

    Declaration
    protected override void OnIterationEnd()
    Overrides
    Randomizer.OnIterationEnd()

    OnIterationStart()

    Generates background layers of objects at the start of each scenario iteration

    Declaration
    protected override void OnIterationStart()
    Overrides
    Randomizer.OnIterationStart()
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)