docs.unity3d.com
    Show / Hide Table of Contents

    Class Randomizer

    Derive Randomizer to implement systems that randomize GameObjects and/or simulation properties.

    Inheritance
    Object
    Randomizer
    AnimationRandomizer
    BackgroundObjectPlacementRandomizer
    ColorRandomizer
    ForegroundObjectPlacementRandomizer
    HueOffsetRandomizer
    RotationRandomizer
    SunAngleRandomizer
    TextureRandomizer
    Namespace: UnityEngine.Perception.Randomization.Randomizers
    Syntax
    public abstract class Randomizer : object

    Properties

    enabled

    Enabled Randomizers are updated, disabled Randomizers are not.

    Declaration
    public bool enabled { get; set; }
    Property Value
    Type Description
    Boolean

    enabledStateCanBeSwitchedByUser

    Some Randomizers should not be disabled by the user as they are critical to the project. E.g. We might want to mark this as false for a foreground objects placement randomizer in some projects

    Declaration
    public bool enabledStateCanBeSwitchedByUser { get; set; }
    Property Value
    Type Description
    Boolean

    scenario

    Returns the scenario containing this Randomizer

    Declaration
    public ScenarioBase scenario { get; }
    Property Value
    Type Description
    ScenarioBase

    tagManager

    Retrieves the RandomizerTagManager of the scenario containing this Randomizer

    Declaration
    public RandomizerTagManager tagManager { get; }
    Property Value
    Type Description
    RandomizerTagManager

    Methods

    OnAwake()

    OnAwake is called when the Randomizer is added or loaded to a scenario

    Declaration
    protected virtual void OnAwake()

    OnCreate()

    OnCreate is called when the Randomizer is added or loaded to a scenario

    Declaration
    protected virtual void OnCreate()

    OnDisable()

    OnDisable is called when the Randomizer becomes disabled

    Declaration
    protected virtual void OnDisable()

    OnEnable()

    OnEnabled is called when the Randomizer becomes enabled and active

    Declaration
    protected virtual void OnEnable()

    OnIterationEnd()

    OnIterationEnd is called the after a Scenario iteration has completed

    Declaration
    protected virtual void OnIterationEnd()

    OnIterationStart()

    OnIterationStart is called at the start of a new Scenario iteration

    Declaration
    protected virtual void OnIterationStart()

    OnScenarioComplete()

    OnScenarioComplete is called the after the entire Scenario has completed

    Declaration
    protected virtual void OnScenarioComplete()

    OnScenarioStart()

    OnScenarioStart is called on the frame the scenario begins iterating

    Declaration
    protected virtual void OnScenarioStart()

    OnStartRunning()

    OnStartRunning is called on the first frame a Randomizer is enabled

    Declaration
    protected virtual void OnStartRunning()

    OnStopRunning()

    OnStartRunning is called on the first frame a disabled Randomizer is updated

    Declaration
    protected virtual void OnStopRunning()

    OnUpdate()

    OnUpdate is executed every frame for enabled Randomizers

    Declaration
    protected virtual void OnUpdate()
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023