本文整理汇总了C#中IniFile.set方法的典型用法代码示例。如果您正苦于以下问题:C# IniFile.set方法的具体用法?C# IniFile.set怎么用?C# IniFile.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IniFile
的用法示例。
在下文中一共展示了IniFile.set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: save
// Save settings
public static void save()
{
IniFile ini = new IniFile();
ini.set(SOUND_ENABLED_KEY, SoundEnabled);
ini.set(MUSIC_ENABLED_KEY, MusicEnabled);
ini.save("Settings");
}
示例2: save
/// <summary>
/// Save options.
/// </summary>
public static void save()
{
#if PACKAGE_INI_FILE
#region Get available languages
#if PACKAGE_SMART_LOCALIZATION
List<CultureInfo> availableLanguages=LanguageManager.Instance.AvailableLanguagesCultureInfo;
string languagesList="";
for (int i=0; i<availableLanguages.Count; ++i)
{
if (i>0)
{
languagesList=languagesList+", ";
}
languagesList=languagesList+availableLanguages[i].Name;
}
#endif
#endregion
IniFile iniFile=new IniFile();
#endif
#region Game
#if OPTION_LANGUAGE
#if PACKAGE_INI_FILE
iniFile.set ("Game.Language", mLanguage, "Application language: "+languagesList);
#else
PlayerPrefs.SetString("Game.Language", mLanguage);
#endif
#endif
#if OPTION_DIFFICULTY
#if PACKAGE_INI_FILE
iniFile.set ("Game.Difficulty", mDifficulty, "Difficulty: 0-"+(difficultyCount-1).ToString());
#else
PlayerPrefs.SetInt("Game.Difficulty", mDifficulty);
#endif
#endif
#if OPTION_BLOOD
#if PACKAGE_INI_FILE
iniFile.set ("Game.Blood", mBlood, "Show blood: True/False");
#else
PlayerPrefs.SetInt("Game.Blood", mBlood ? 1 : 0);
#endif
#endif
#if OPTION_USE_HINTS
#if PACKAGE_INI_FILE
iniFile.set ("Game.UseHints", mUseHints, "Use hints: True/False");
#else
PlayerPrefs.SetInt("Game.UseHints", mUseHints ? 1 : 0);
#endif
#endif
#if OPTION_AUTOSAVE
#if PACKAGE_INI_FILE
iniFile.set ("Game.Autosave", mAutosave, "Enable autosave: True/False");
#else
PlayerPrefs.SetInt("Game.Autosave", mAutosave ? 1 : 0);
#endif
#endif
#endregion
#region Audio
#if OPTION_SOUND
#if PACKAGE_INI_FILE
iniFile.set ("Audio.Sound", mSound, "Sound: True/False");
#else
PlayerPrefs.SetInt("Audio.Sound", mSound ? 1 : 0);
#endif
#endif
#if OPTION_MASTER_VOLUME
#if PACKAGE_INI_FILE
iniFile.set ("Audio.MasterVolume", mMasterVolume, "Master volume: 0-1");
#else
PlayerPrefs.SetFloat("Audio.MasterVolume", mMasterVolume);
#endif
#endif
#if OPTION_MUSIC_VOLUME
#if PACKAGE_INI_FILE
iniFile.set ("Audio.MusicVolume", mMusicVolume, "Music volume: 0-1");
#else
PlayerPrefs.SetFloat("Audio.MusicVolume", mMusicVolume);
#endif
#endif
#if OPTION_VOICE_VOLUME
#if PACKAGE_INI_FILE
iniFile.set ("Audio.VoiceVolume", mVoiceVolume, "Voice volume: 0-1");
#else
PlayerPrefs.SetFloat("Audio.VoiceVolume", mVoiceVolume);
//.........这里部分代码省略.........