成品小游戏源码,FairyGUI-GSlider滑动条

成品小游戏源码,FairyGUI-GSlider滑动条实现的相关代码
代码实现

```cpp
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using FairyGUI;
/*
* Author:W
* 滑动组件使用:音量设置,操作精度设置等
*/
public class GSliderTest : MonoBehaviour {

private GComponent root;

private GSlider slider;

void Awake()
{
UIPackage.AddPackage("UI/Basics");
}


// Use this for initialization
void Start () {
root = this.GetComponent<UIPanel>().ui;

slider = root.GetChild("n3").asSlider;
slider.onChanged.Add(()=> {

Debug.Log("滑动条当前的值==="+slider.value);
});

}

// Update is called once per frame
void Update () {

}
}
```

 


以上就是成品小游戏源码,FairyGUI-GSlider滑动条实现的相关代码, 更多内容欢迎关注之后的文章

posted @ 2021-08-02 14:13  云豹科技-苏凌霄  阅读(69)  评论(0编辑  收藏  举报