Exemplo n.º 1
0
 private void SetToggles(YxBaseToggleAdapter toggle, bool state)
 {
     if (toggle == null)
     {
         return;
     }
     toggle.StartsActive = state;
     toggle.Value        = state;
 }
Exemplo n.º 2
0
        /// <summary>
        /// 组的类型
        /// </summary>
        /// <param name="toggle"></param>
        public void OnGameGroupToggle(YxBaseToggleAdapter toggle)
        {
            if (!toggle.Value)
            {
                return;
            }
            var groupTypeStr = toggle.name;
            int groupType;

            if (!int.TryParse(groupTypeStr, out groupType))
            {
                return;
            }
            var index = GameListModel.Instance.GetGroupIndexByType(groupType);

            GameListController.Instance.ShowGameList(index, DataFormat);
        }
Exemplo n.º 3
0
        public void OnChangeToggle(YxBaseToggleAdapter toggle)
        {
            if (toggle == null)
            {
                return;
            }
            var value = toggle.Value ? 1 : 0;
            var index = Array.IndexOf(MusiceToggles, toggle);

            if (index == 0)
            {
                Facade.Instance <MusicManager>().MusicVolume = value;
            }
            else
            {
                Facade.Instance <MusicManager>().EffectVolume = value;
            }
        }