docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ForegroundObjectPlacementRandomizer

    Creates a 2D layer of of evenly spaced GameObjects from a given list of prefabs

    Inheritance
    object
    Randomizer
    ForegroundObjectPlacementRandomizer
    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/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
    Randomizer.OnAwake()

    OnIterationEnd()

    Deletes generated foreground objects after each scenario iteration is complete

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

    OnIterationStart()

    Generates a foreground layer 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)