Selaa lähdekoodia

修复ResourceComponent unload判断,判断AssetBundle==null的情况不能使用.?,因为unity的Object判断null是通过重载==操作符作了自己的一重判断

tanghai 6 vuotta sitten
vanhempi
commit
5bf97d774f
1 muutettua tiedostoa jossa 4 lisäystä ja 2 poistoa
  1. 4 2
      Unity/Assets/Model/Module/AssetsBundle/ResourcesComponent.cs

+ 4 - 2
Unity/Assets/Model/Module/AssetsBundle/ResourcesComponent.cs

@@ -3,7 +3,6 @@ using System.Collections.Generic;
 using System.IO;
 using System.Linq;
 using System.Text;
-using System.Threading.Tasks;
 using UnityEngine;
 #if UNITY_EDITOR
 using UnityEditor;
@@ -50,7 +49,10 @@ namespace ETModel
 
 			//Log.Debug($"desdroy assetbundle: {this.Name}");
 
-			this.AssetBundle?.Unload(true);
+			if (this.AssetBundle != null)
+			{
+				this.AssetBundle.Unload(true);
+			}
 		}
 	}