docs.unity3d.com
    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
    Namespace: UnityEditor.Rendering
    Syntax
    public class LightUnitSlider

    Constructors

    LightUnitSlider(LightUnitSliderUIDescriptor)

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

    Fields

    m_Descriptor

    Declaration
    protected readonly LightUnitSliderUIDescriptor m_Descriptor
    Field Value
    Type Description
    LightUnitSliderUIDescriptor

    m_SerializedObject

    Declaration
    protected SerializedObject m_SerializedObject
    Field Value
    Type Description
    SerializedObject

    Methods

    DoSlider(Rect, ref Single, 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
    Single value
    Vector2 sliderRange

    DoSlider(Rect, ref Single, Vector2, Vector2)

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

    Draw(Rect, SerializedProperty, ref Single)

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

    GetLightUnitTooltip(String, Single, String)

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

    GetPositionOnSlider(Single)

    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
    Single value
    Returns
    Type Description
    Single

    GetPositionOnSlider(Single, Vector2)

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

    SetSerializedObject(SerializedObject)

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

    SetValueToPreset(SerializedProperty, LightUnitSliderUIRange)

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

    Extension Methods

    ReflectionUtils.Invoke(Object, String, Object[])
    ReflectionUtils.SetField(Object, String, Object)
    ReflectionUtils.GetField(Object, String)
    ReflectionUtils.GetFields(Object)
    Back to top
    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