当前位置: 首页>>代码示例>>C#>>正文


C# IniFile.load方法代码示例

本文整理汇总了C#中IniFile.load方法的典型用法代码示例。如果您正苦于以下问题:C# IniFile.load方法的具体用法?C# IniFile.load怎么用?C# IniFile.load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IniFile的用法示例。


在下文中一共展示了IniFile.load方法的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);
//.........这里部分代码省略.........
开发者ID:Gris87,项目名称:PingPong3D,代码行数:101,代码来源:Options.cs


注:本文中的IniFile.load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。