/// <summary> /// 修改游戏设置 /// </summary> /// <param name="item"></param> /// <param name="newValue"></param> public void ModifyGameSetting(GameSettingIndex item, string newValue) { if (currentGameSettingTable.ContainsKey(item)) { currentGameSettingTable[item] = newValue; } }
public float GetGameSettingDefaultFloatValue(GameSettingIndex item) { float fValue = 0; if (defaultGameSettingTable.ContainsKey(item)) { float.TryParse(defaultGameSettingTable[item], out fValue); } return(fValue); }
public string GetGameSettingStringValue(GameSettingIndex item) { string stValue = ""; if (currentGameSettingTable.ContainsKey(item)) { stValue = currentGameSettingTable[item]; } return(stValue); }
public int GetGameSettingIntValue(GameSettingIndex item) { int nValue = 0; if (currentGameSettingTable.ContainsKey(item)) { int.TryParse(currentGameSettingTable[item], out nValue); } return(nValue); }
public bool GetGameSettingBoolValue(GameSettingIndex item) { int nValue = 0; if (currentGameSettingTable.ContainsKey(item)) { int.TryParse(currentGameSettingTable[item], out nValue); } return(nValue == 1 ? true : false); }
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]; } } } } }