Exemplo n.º 1
0
        public static void ApplyTypeSetting(int type)
        {
            int value = GameQualitySettingManager.GetSettingByType(type);

            var list = GetSubOptions(type);

            foreach (var item in list)
            {
                VideoSetting data = GameQualitySettingManager.VideoSettingDic[item];
                if (data.ValuePerLevel != null && data.ValuePerLevel.Count > 0)
                {
                    if (value > -1 && value < data.ValuePerLevel.Count)
                    {
                        int index = data.ValuePerLevel[value];
                        if (index > -1 && index < data.LevelDatas.Count)
                        {
                            float fdata = data.LevelDatas[index];
                            ApplyVideoEffect((EVideoSettingId)item, fdata);
                        }
                        else
                        {
                            Debug.Log("error videosetting id" + item + " value " + value + "index" + index);
                        }
                    }
                    else
                    {
                        Debug.Log("error videosetting id" + item + " value " + value);
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void UnRegisterVideoSettingCallback()
        {
            foreach (var list in cacheSetters)
            {
                foreach (var item in list.Value)
                {
                    GameQualitySettingManager.UnRegSettingChangeCallback(list.Key, item, null);
                }
            }

            foreach (var item in cacheGetters)
            {
                GameQualitySettingManager.UnRegSettingChangeCallback(item.Key, null, item.Value);
            }
        }
Exemplo n.º 3
0
        public void RegisterVideoSettingCallback(EVideoSettingId id, Action <float> setter, Func <string> getter)
        {
            List <Action <float> > list = null;

            if (cacheSetters.TryGetValue(id, out list))
            {
            }
            else
            {
                list             = new List <Action <float> >();
                cacheSetters[id] = list;
            }
            list.Add(setter);

            cacheGetters[id] = getter;

            GameQualitySettingManager.RegSettingChangeCallback(id, setter, getter);
        }
Exemplo n.º 4
0
 public void UseVideoSettingCallbacCallback(EVideoSettingId id, float value)
 {
     GameQualitySettingManager.ApplyVideoEffect(id, value);
 }