using UnityEngine; using UnityEngine.UI; using Rokid.MRC; public delegate void ButtonFunc(GameObject obj, object userData); public delegate void ToggleFunc(GameObject obj, bool isOn); public delegate void DropdownFunc(GameObject obj, int index); public delegate void InputFieldFunc(GameObject obj, string val); public delegate void InputFieldEndFunc(GameObject obj, string val); public delegate void ScrollRectFunc(GameObject obj, Vector2 pos); public delegate void SliderFunc(GameObject obj, float val); // UI绑定事件接口 public static class UguiEvent { //主要有Button、Toggle、Dropdown(下拉框)、InputField(输入框)、ScrollRect、Slider public static void ButtonClick(GameObject go, ButtonFunc func, object userData = null) { Button button = go.GetComponent