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


C# IniFile.set方法代码示例

本文整理汇总了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");
    }
开发者ID:Gris87,项目名称:PinataZigorata,代码行数:10,代码来源:Settings.cs

示例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);
//.........这里部分代码省略.........
开发者ID:Gris87,项目名称:PingPong3D,代码行数:101,代码来源:Options.cs


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