本文整理汇总了C#中IniFile.count方法的典型用法代码示例。如果您正苦于以下问题:C# IniFile.count方法的具体用法?C# IniFile.count怎么用?C# IniFile.count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IniFile
的用法示例。
在下文中一共展示了IniFile.count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: load
/// <summary>
/// Load options.
/// </summary>
public static void load()
{
Debug.Log("Loading settings");
#if PACKAGE_INI_FILE
IniFile iniFile=new IniFile("Settings");
if (iniFile.count()==0)
{
save();
iniFile.load("Settings");
}
#endif
#region Game
#if OPTION_LANGUAGE
LanguageManager languageManager=LanguageManager.Instance;
#if PACKAGE_INI_FILE
mLanguage=iniFile.get ("Game.Language", languageManager.GetSystemLanguage());
#else
mLanguage=PlayerPrefs.GetString("Game.Language", languageManager.GetSystemLanguage());
#endif
if (!languageManager.IsLanguageSupported(mLanguage))
{
mLanguage="en";
}
Debug.Log("Application language: "+mLanguage);
languageManager.ChangeLanguage(mLanguage);
#endif
#if OPTION_DIFFICULTY
#if PACKAGE_INI_FILE
mDifficulty=iniFile.get ("Game.Difficulty", difficultyCount/2);
#else
mDifficulty=PlayerPrefs.GetInt("Game.Difficulty", difficultyCount/2);
#endif
Debug.Log("Difficulty: "+mDifficulty.ToString());
#endif
#if OPTION_BLOOD
#if PACKAGE_INI_FILE
mBlood=iniFile.get ("Game.Blood", true);
#else
mBlood=PlayerPrefs.GetInt("Game.Blood", 1)==1;
#endif
Debug.Log("Blood: "+mBlood.ToString());
#endif
#if OPTION_USE_HINTS
#if PACKAGE_INI_FILE
mUseHints=iniFile.get ("Game.UseHints", true);
#else
mUseHints=PlayerPrefs.GetInt("Game.UseHints", 1)==1;
#endif
Debug.Log("Use hints: "+mUseHints.ToString());
#endif
#if OPTION_AUTOSAVE
#if PACKAGE_INI_FILE
mAutosave=iniFile.get ("Game.Autosave", true);
#else
mAutosave=PlayerPrefs.GetInt("Game.Autosave", 1)==1;
#endif
Debug.Log("Autosave: "+mAutosave.ToString());
#endif
#endregion
#region Audio
#if OPTION_SOUND
#if PACKAGE_INI_FILE
mSound=iniFile.get ("Audio.Sound", true);
#else
mSound=PlayerPrefs.GetInt("Audio.Sound", 1)==1;
#endif
Debug.Log("Sound: "+mSound.ToString());
#endif
#if OPTION_MASTER_VOLUME
#if PACKAGE_INI_FILE
mMasterVolume=iniFile.get ("Audio.MasterVolume", 1f);
#else
mMasterVolume=PlayerPrefs.GetFloat("Audio.MasterVolume", 1f);
#endif
Debug.Log("Master volume: "+mMasterVolume.ToString());
#endif
#if OPTION_MUSIC_VOLUME
#if PACKAGE_INI_FILE
mMusicVolume=iniFile.get ("Audio.MusicVolume", 1f);
//.........这里部分代码省略.........