docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class LightRandomizerTag

    Supports the ability to randomize the light state (on/off), intensity (in the unit specified in the Light component), temperature (if using color temperature), and color.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    RandomizerTag
    LightRandomizerTag
    Inherited Members
    RandomizerTag.OnEnable()
    RandomizerTag.OnDisable()
    RandomizerTag.Register()
    RandomizerTag.Unregister()
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StartCoroutine_Auto(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, bool)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>(bool)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(string)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.Perception.Randomization.Randomizers
    Assembly: Unity.Perception.Runtime.dll
    Syntax
    [AddComponentMenu("Perception/RandomizerTags/Light Randomizer Tag")]
    [MovedFrom("UnityEngine.Perception.Internal")]
    public class LightRandomizerTag : RandomizerTag

    Fields

    color

    Values for each channel (range: 0 to 1) will be sampled based on the chosen Sampling method under Value and set as the Light component's color/filter. When using the Filter and Temperate mode for Light Appearance (under Emission for HDRP lights only), filter will be changed. Otherwise, color will be changed.

    Declaration
    [Tooltip("Values for each channel (range: 0 to 1) will be sampled based on the chosen Sampling method under Value and set as the Light component's color/filter. When using the Filter and Temperate mode for Light Appearance (under Emission for HDRP lights only), filter will be changed. Otherwise, color will be changed.")]
    public ColorRgbParameter color
    Field Value
    Type Description
    ColorRgbParameter

    colorList

    Randomly chooses a color from the options provided and assigns it to the Light component based on the Light Appearance mode set for the component (under Emission for HDRP lights only). If the Filter and Temperature mode is used, the selected color will be applied as a filter to the light. Otherwise if the Color mode is used, the selected color will used as the light's emission color. The probability of each color being selected can be modified by disabling the Uniform flag and providing probability values manually.

    Declaration
    [Tooltip("Randomly chooses a color from the options provided, if there exists any, and assigns it to the Light component based on the Light Appearance mode set for the component (under Emission for HDRP lights only). If the Filter and Temperature mode is used, the selected color will be applied as a filter to the light. Otherwise if the Color mode is used, the selected color will used as the light's emission color. The probability of each color being selected can be modified by disabling the Uniform flag and providing probability values manually.")]
    public CategoricalParameter<Color> colorList
    Field Value
    Type Description
    CategoricalParameter<Color>
    Remarks

    If no colors are provided, the light color will remain unchanged.

    intensity

    A value will be sampled based on the chosen Sampling method under Value and set as the Light component's Intensity. The unit for intensity will be the same as the one set under Emission in the Light component.

    Declaration
    [Tooltip("A value will be sampled based on the chosen Sampling method under Value. The unit for intensity will be the same as the one set under Emission. ")]
    public FloatParameter intensity
    Field Value
    Type Description
    FloatParameter

    intensityList

    Randomly chooses an intensity from the options provided and assigns it to the Light component in the unit specified under Emission. The probability of each color being selected can be modified by disabling the Uniform flag and providing probability values manually.

    Declaration
    [Tooltip("Randomly chooses an intensity from the options provided and assigns it to the Light component in the unit specified under Emission. The probability of each color being selected can be modified by disabling the `Uniform flag and providing probability values manually.")]
    public CategoricalParameter<float> intensityList
    Field Value
    Type Description
    CategoricalParameter<float>
    Remarks

    If no values are provided, the light intensity will remain unchanged.

    specifyColorAsList

    When set to true, colorList will be sampled to set the color/filter of the Light component. When set to false, color will be used instead.

    Declaration
    [Tooltip("When set to true, values for color will be sampled from a list of values. When false, a range of values will be used instead.")]
    public bool specifyColorAsList
    Field Value
    Type Description
    bool

    specifyIntensityAsList

    When set to true, intensityList will be sampled to set the intensity of the Light component. When set to false, intensity will be used instead.

    Declaration
    [Tooltip("When set to true, values for intensity will be sampled from a list of values. When false, a range of values will be used instead.")]
    public bool specifyIntensityAsList
    Field Value
    Type Description
    bool

    specifyTemperatureAsList

    When set to true, temperatureList will be sampled to set the temperature of the Light component. When set to false, temperature will be used instead.

    Declaration
    [Tooltip("When set to true, values for temperature will be sampled from a list of values. When false, a range of values will be used instead.")]
    public bool specifyTemperatureAsList
    Field Value
    Type Description
    bool

    state

    A value between 0 and 1 will be randomly chosen. If that value is above the threshold, it will return true. Else it will return false.

    Declaration
    [Tooltip("The probability for the light to be off. At a threshold (probability) of 0, the light will always be on; at 1, always off and at 0.4, on about 60% of the time.")]
    public BooleanParameter state
    Field Value
    Type Description
    BooleanParameter
    Remarks

    At 0, light will always be enabled; At 1, always disabled; At 0.5, enabled half the time.

    temperature

    A value will be sampled based on the chosen Sampling method under Value and set as the Light component's Temperature. Only utilized when using the Filter and Temperate mode for Light Appearance (under Emission for HDRP lights only).

    Declaration
    [Tooltip("A value will be sampled based on the chosen Sampling method under Value and set as the Light component's Temperature. This is only utilized when using the Filter and Temperate mode for Light Appearance (under Emission for HDRP lights only).")]
    public FloatParameter temperature
    Field Value
    Type Description
    FloatParameter

    temperatureList

    Randomly chooses a temperature from the options provided and assigns it to the Light component if the Light Appearance mode (under Emission) is set to Filter and Temperature (HDRP only). The probability of each color being selected can be modified by disabling the Uniform flag and providing probability values manually.

    Declaration
    [Tooltip("Randomly chooses a temperature from the options provided and assigns it to the Light component if the Light Appearance mode (under Emission) is set to Filter and Temperature (HDRP only). The probability of each color being selected can be modified by disabling the Uniform flag and providing probability values manually.")]
    public CategoricalParameter<float> temperatureList
    Field Value
    Type Description
    CategoricalParameter<float>
    Remarks

    If no values are provided, the light temperature will remain unchanged.

    Methods

    Randomize()

    Based on the configuration of the LightRandomizerTag, randomize state, intensity, temperature, and color of the Light component.

    Declaration
    public void Randomize()
    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)