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


C# ByteReader.ReadDictionary方法代码示例

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


在下文中一共展示了ByteReader.ReadDictionary方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Start

        private void Start()
        {
#if !UNITY_METRO
            // Check for overridden localization data.
            var localizationFilePath = Application.persistentDataPath + "/Localization.txt";
            FileInfo localizationFile = new FileInfo(localizationFilePath);

            if (localizationFile.Exists)
            {
                Debug.Log("Found localization file at " + localizationFilePath);

                using (var fileStream = localizationFile.OpenRead())
                {
                    using (var binaryReader = new BinaryReader(fileStream))
                    {
                        var bytes = binaryReader.ReadBytes((int)localizationFile.Length);
                        var nguiByteReader = new ByteReader(bytes);
                        var localizationData = nguiByteReader.ReadDictionary();
                        Localization.Set("TestLanguage", localizationData);
                        return;
                    }
                }
            }
#endif

            // Get current system language.
            SystemLanguage systemLanguage = Application.systemLanguage;
            Debug.Log(string.Format("System Language: {0}", systemLanguage));

            // Check if available, otherwise fallback to English.
            TextAsset textAsset = Resources.Load(systemLanguage.ToString(), typeof(TextAsset)) as TextAsset;
            if (textAsset == null)
            {
                systemLanguage = SystemLanguage.English;
                Debug.Log(string.Format("Using fallback language: {0}", systemLanguage));
            }

            Localization.language = systemLanguage.ToString();
        }
开发者ID:jixiang111,项目名称:slash-framework,代码行数:39,代码来源:LocalizationBehaviour.cs

示例2: Load

	/// <summary>
	/// Load the specified asset and activate the localization.
	/// </summary>

	static public void Load (TextAsset asset)
	{
		ByteReader reader = new ByteReader(asset);
		Set(asset.name, reader.ReadDictionary());
	}
开发者ID:Jefferson-Henrique,项目名称:fuzzy-char-creation,代码行数:9,代码来源:Localization.cs

示例3: Load

 /// <summary>
 /// Load the specified asset and activate the localization.
 /// </summary>
 void Load(TextAsset asset)
 {
     mLanguage = asset.name;
     PlayerPrefs.SetString("Language", mLanguage);
     ByteReader reader = new ByteReader(asset);
     mDictionary = reader.ReadDictionary();
     UIRoot.Broadcast("OnLocalize", this);
 }
开发者ID:KurtLoeffler,项目名称:DoNotShake,代码行数:11,代码来源:Localization.cs

示例4: Set

	/// <summary>
	/// Set the localization data directly.
	/// </summary>

	static public void Set (string languageName, byte[] bytes)
	{
		ByteReader reader = new ByteReader(bytes);
		Set(languageName, reader.ReadDictionary());
	}
开发者ID:ChuHaiLing,项目名称:Drak_pro,代码行数:9,代码来源:Localization.cs

示例5: Load

	/// <summary>
	/// Load the specified asset and activate the localization.
	/// </summary>

	public void Load (TextAsset asset)
	{
		ByteReader reader = new ByteReader(asset);
		Set(asset.name, reader.ReadDictionary());
		OnLocalizationChanged();
	}
开发者ID:unit9,项目名称:swip3,代码行数:10,代码来源:Localization.cs

示例6: Set

 public static void Set(string languageName, byte[] bytes)
 {
     ByteReader byteReader = new ByteReader(bytes);
     Localization.Set(languageName, byteReader.ReadDictionary());
 }
开发者ID:floatyears,项目名称:Decrypt,代码行数:5,代码来源:Localization.cs

示例7: Load

 public static void Load(TextAsset asset)
 {
     ByteReader byteReader = new ByteReader(asset);
     Localization.Set(asset.name, byteReader.ReadDictionary());
 }
开发者ID:floatyears,项目名称:Decrypt,代码行数:5,代码来源:Localization.cs

示例8: Load

 static public void Load(byte[] asset)
 {
     mDictionary.Clear();
     ByteReader reader = new ByteReader(asset);
     mDictionary = reader.ReadDictionary();
 }
开发者ID:yuyangame,项目名称:hugula,代码行数:6,代码来源:Localization.cs

示例9: MusicPathManager

 private MusicPathManager()
 {
     TextAsset musicPath = Resources.Load("audioSources/MusicPath") as TextAsset;
     ByteReader reader = new ByteReader(musicPath);
     mDictionary = reader.ReadDictionary();
 }
开发者ID:rogeryuan99,项目名称:Hello,代码行数:6,代码来源:MusicPathManager.cs


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