docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method AddSliderControl

    AddSliderControl(string, float, UnityAction<float>)

    Creates a new slider control with the passed in name and default value. The slider's value runs from 0 to 1. The passed in listener will be called on slider changes. If anything goes wrong this method will return null. Returns the control panel element upon a successful add.

    Declaration
    public GameObject AddSliderControl(string name, float defaultValue, UnityAction<float> listener)
    Parameters
    Type Name Description
    string name

    The name of the slider control

    float defaultValue

    The default value of the slider, between 0 and 1

    UnityAction<float> listener

    The callback action that will be triggered when the slider's value changes

    Returns
    Type Description
    GameObject

    The created slider

    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)