docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class LightUnitSlider

    Formats the provided descriptor into a linear slider with contextual slider markers, tooltips, and icons.

    Inheritance
    object
    LightUnitSlider
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEditor.Rendering
    Assembly: Unity.RenderPipelines.Core.Editor.dll
    Syntax
    public class LightUnitSlider

    Constructors

    LightUnitSlider(LightUnitSliderUIDescriptor)

    Constructor with a LightUnitSliderUIDescriptor

    Declaration
    public LightUnitSlider(LightUnitSliderUIDescriptor descriptor)
    Parameters
    Type Name Description
    LightUnitSliderUIDescriptor descriptor

    The LightUnitSliderUIDescriptor

    Fields

    m_Descriptor

    The LightUnitSliderUIDescriptor

    Declaration
    protected readonly LightUnitSliderUIDescriptor m_Descriptor
    Field Value
    Type Description
    LightUnitSliderUIDescriptor

    m_SerializedObject

    The SerializedObject that contains a Light

    Declaration
    protected SerializedObject m_SerializedObject
    Field Value
    Type Description
    SerializedObject

    Methods

    DoSlider(Rect, ref float, Vector2)

    Draws a linear slider mapped to the min/max value range. Override this for different slider behavior (texture background, power).

    Declaration
    protected virtual void DoSlider(Rect rect, ref float value, Vector2 sliderRange)
    Parameters
    Type Name Description
    Rect rect

    The Rect to draw the slider.

    float value

    The current value, and also returns the modified value.

    Vector2 sliderRange

    The ranges of the slider.

    DoSlider(Rect, ref float, Vector2, Vector2)

    Draws the slider

    Declaration
    protected virtual void DoSlider(Rect rect, ref float value, Vector2 sliderRange, Vector2 _)
    Parameters
    Type Name Description
    Rect rect

    The Rect to draw the slider.

    float value

    The current value, and also returns the modified value.

    Vector2 sliderRange

    The ranges of the slider.

    Vector2 _

    Not used

    Draw(Rect, SerializedProperty, ref float)

    Draws the slider in a given Rect

    Declaration
    public virtual void Draw(Rect rect, SerializedProperty value, ref float floatValue)
    Parameters
    Type Name Description
    Rect rect

    The Rect to draw the slider into

    SerializedProperty value

    The SerializedProperty with the property serialized

    float floatValue

    The float value modified by the slider GUI

    GetLightUnitTooltip(string, float, string)

    Gets the tooltip

    Declaration
    protected virtual GUIContent GetLightUnitTooltip(string baseTooltip, float value, string unit)
    Parameters
    Type Name Description
    string baseTooltip

    The base tooltip

    float value

    The value

    string unit

    The units

    Returns
    Type Description
    GUIContent

    A well formed tooltip on a GUIContent

    GetPositionOnSlider(float)

    Maps a light unit value onto the slider. Keeps in sync placement of markers and tooltips with the slider power. Override this in case of non-linear slider.

    Declaration
    protected virtual float GetPositionOnSlider(float value)
    Parameters
    Type Name Description
    float value

    The value to get the position

    Returns
    Type Description
    float

    The position on the slider

    GetPositionOnSlider(float, Vector2)

    Maps a light unit value onto the slider. Keeps in sync placement of markers and tooltips with the slider power. Override this in case of non-linear slider.

    Declaration
    protected virtual float GetPositionOnSlider(float value, Vector2 valueRange)
    Parameters
    Type Name Description
    float value

    The value to get the position at

    Vector2 valueRange

    The ranges of the values

    Returns
    Type Description
    float

    The position

    SetSerializedObject(SerializedObject)

    Modifies the SerializedObject for this Light slider

    Declaration
    public void SetSerializedObject(SerializedObject serialized)
    Parameters
    Type Name Description
    SerializedObject serialized

    The SerializedObject representing the serialized data to be used by this slider.

    SetValueToPreset(SerializedProperty, LightUnitSliderUIRange)

    The serialized property for color temperature is stored in the build-in light editor, and we need to use this object to apply the update.

    Declaration
    protected virtual void SetValueToPreset(SerializedProperty value, LightUnitSliderUIRange preset)
    Parameters
    Type Name Description
    SerializedProperty value

    The value to update

    LightUnitSliderUIRange preset

    The preset range

    Extension Methods

    ReflectionUtils.GetField(object, string)
    ReflectionUtils.GetFields(object)
    ReflectionUtils.Invoke(object, string, params object[])
    ReflectionUtils.SetField(object, string, object)
    AnalyticsUtils.ToNestedColumnWithDefault<T>(T, T, bool)
    AnalyticsUtils.ToNestedColumn<T>(T, T)
    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)