示例#1
0
 /// <summary>
 /// 修改游戏设置
 /// </summary>
 /// <param name="item"></param>
 /// <param name="newValue"></param>
 public void ModifyGameSetting(GameSettingIndex item, string newValue)
 {
     if (currentGameSettingTable.ContainsKey(item))
     {
         currentGameSettingTable[item] = newValue;
     }
 }
示例#2
0
        public float GetGameSettingDefaultFloatValue(GameSettingIndex item)
        {
            float fValue = 0;

            if (defaultGameSettingTable.ContainsKey(item))
            {
                float.TryParse(defaultGameSettingTable[item], out fValue);
            }
            return(fValue);
        }
示例#3
0
        public string GetGameSettingStringValue(GameSettingIndex item)
        {
            string stValue = "";

            if (currentGameSettingTable.ContainsKey(item))
            {
                stValue = currentGameSettingTable[item];
            }
            return(stValue);
        }
示例#4
0
        public int GetGameSettingIntValue(GameSettingIndex item)
        {
            int nValue = 0;

            if (currentGameSettingTable.ContainsKey(item))
            {
                int.TryParse(currentGameSettingTable[item], out nValue);
            }
            return(nValue);
        }
示例#5
0
        public bool GetGameSettingBoolValue(GameSettingIndex item)
        {
            int nValue = 0;

            if (currentGameSettingTable.ContainsKey(item))
            {
                int.TryParse(currentGameSettingTable[item], out nValue);
            }
            return(nValue == 1 ? true : false);
        }
示例#6
0
        private void LoadLocalAndCoverConfig()
        {
            List <PlayerSettingData> tempList;

            if (PlayerSettingLocalConfig.PlayerSettingLocalConfig.Instance.GetLocalData(PlayerSettingDataType.GameSetting, out tempList))
            {
                foreach (PlayerSettingData data in tempList)
                {
                    System.Object resultObj = null;
                    if (StringHelper.StringToEnum(typeof(GameSettingIndex), data.m_DataName, out resultObj))
                    {
                        GameSettingIndex index = (GameSettingIndex)resultObj;
                        if (currentGameSettingTable.ContainsKey(index))
                        {
                            currentGameSettingTable[index] = data.m_DataValueList[0];
                        }
                    }
                }
            }
        }