Преглед изворни кода

1.修复了mongo一个bug
2.修复ResourcesComponent组件同步资源加载路径错误

tanghai пре 8 година
родитељ
комит
1c9e8b5e1e

+ 7 - 1
Unity/Assets/Plugins/MongoDB/MongoDB.Bson/IO/BsonTrie.cs

@@ -16,6 +16,7 @@
 using System;
 using System.IO;
 using System.Text;
+using UnityEngine;
 
 namespace MongoDB.Bson.IO
 {
@@ -240,7 +241,12 @@ namespace MongoDB.Bson.IO
             }
             else if (_children != null)
             {
-                var index = (uint)((int)keyByte - _minChildKeyByte);
+                // 这里做了修改,il2cpp uint跟int比较有bug
+                int index = keyByte - _minChildKeyByte;
+                if (index < 0)
+                {
+                    return null;
+                }
                 if (index < _childrenIndexes.Length)
                 {
                     index = _childrenIndexes[index];

+ 1 - 1
Unity/Assets/Res/Unit/Skeleton/Texture/Skeleton_D.tif.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
 guid: 943f3c476130c4f4f8ae55ef3ccd38ba
-timeCreated: 1510969659
+timeCreated: 1510979420
 licenseType: Free
 TextureImporter:
   fileIDToRecycleName: {}

+ 2 - 2
Unity/Assets/Scripts/Component/BundleDownloaderComponent.cs

@@ -46,10 +46,9 @@ namespace Model
 				Log.Debug(versionUrl);
 				await request.DownloadAsync(versionUrl);
 				this.VersionConfig = MongoHelper.FromJson<VersionConfig>(request.Request.downloadHandler.text);
-				Log.Info(MongoHelper.ToJson(this.VersionConfig));
 			}
 			
-			Log.Debug(MongoHelper.ToJson(this.VersionConfig));
+			Log.Debug("WebVersion:\n" + MongoHelper.ToJson(this.VersionConfig));
 
 			// 对比本地的Version.txt
 			string versionPath = Path.Combine(PathHelper.AppHotfixResPath, "Version.txt");
@@ -69,6 +68,7 @@ namespace Model
 			{
 
 				VersionConfig localVersionConfig = MongoHelper.FromJson<VersionConfig>(File.ReadAllText(versionPath));
+				Log.Debug("LocalVersion:\n" + MongoHelper.ToJson(localVersionConfig));
 				// 先删除服务器端没有的ab
 				foreach (FileVersionInfo fileVersionInfo in localVersionConfig.FileVersionInfos)
 				{

+ 1 - 1
Unity/Assets/Scripts/Component/ResourcesComponent.cs

@@ -183,7 +183,7 @@ namespace Model
 #endif
 			}
 
-			AssetBundle assetBundle = AssetBundle.LoadFromFile(Path.Combine(PathHelper.AppResPath, assetBundleName));
+			AssetBundle assetBundle = AssetBundle.LoadFromFile(Path.Combine(PathHelper.AppHotfixResPath, assetBundleName));
 
 			if (!assetBundle.isStreamedSceneAssetBundle)
 			{