Slider滑动条操作

Slider滑动条操作

代码

using UnityEngine;
using UnityEngine.UI;

public class Juse : MonoBehaviour
{
    public Slider slider;
    void Start()
    {
        float num = 4;
        string str = "string";
        slider.onValueChanged.AddListener((value) => SliderControl(value, num, str));
    }
    public void SliderControl(float value1, float num1, string str1)
    {
        Debug.Log(value1 + " " + num1 + " " + str1);
    }
}

  

  

posted @ 2023-06-19 11:45  gatran  阅读(13)  评论(0编辑  收藏  举报