Esempio n. 1
0
        /// <summary>
        /// 手动设置当前选择项
        /// </summary>
        /// <param name="group"></param>
        /// <param name="val"></param>
        public static void SetValue(this ToggleGroup group, int val)
        {
            var com = ToggleGroupExtension.Get(group.gameObject);

            if (com != null)
            {
                com.SetValue(val);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 为其删除一个状态变化的监听
        /// </summary>
        /// <param name="group"></param>
        /// <param name="lis"></param>
        public static void RemoveValueChangeListener(this ToggleGroup group, OnValueChangeListener lis)
        {
            var com = ToggleGroupExtension.Get(group.gameObject);

            if (com != null)
            {
                com.ValueChangeListener -= lis;
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 获取当前选择项
        /// </summary>
        /// <param name="group"></param>
        /// <returns></returns>
        public static int GetValue(this ToggleGroup group)
        {
            var com = ToggleGroupExtension.Get(group.gameObject);

            if (com != null)
            {
                return(com.GetValue());
            }
            return(0);
        }