Example #1
0
        public static void TestReadConfig()
        {
            TextAsset asset = (Selection.activeObject as TextAsset);

            if (asset == null)
            {
                return;
            }
            byte[] buffer = asset.bytes;
            if (buffer == null || buffer.Length <= 0)
            {
                return;
            }

            string fileName = AssetDatabase.GetAssetPath(Selection.activeObject);

            if (string.IsNullOrEmpty(fileName))
            {
                return;
            }

            string configName = Path.GetFileNameWithoutExtension(fileName);

            ConfigConvertManager.BuildConfigConvert();
            var info = ConfigConvertManager.GetTargetConvert(configName);

            if (info == null)
            {
                return;
            }

            IDictionary map = ConfigWrap.TestCommonToObject(buffer, info.type, info.DictionaryType, true);

            if (map != null)
            {
                Debug.Log("二进制配置读取正确");
            }
            else
            {
                Debug.LogError("二进制配置读取错误");
            }
        }
Example #2
0
 public static void TestBuildConfigConvertMap()
 {
     ConfigConvertManager.BuildConfigConvert();
 }