tanghai 8 лет назад
Родитель
Сommit
586f26d459
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      Unity/Assets/Scripts/Helper/ResourceHelper.cs

+ 4 - 0
Unity/Assets/Scripts/Helper/ResourceHelper.cs

@@ -7,9 +7,13 @@ namespace Model
 	{
 		public static UnityEngine.Object LoadResource(string bundleName, string prefab)
 		{
+#if  UNITY_EDITOR
 			string[] realPath = AssetDatabase.GetAssetPathsFromAssetBundleAndAssetName(bundleName.ToLower() + ".unity3d", prefab);
 			UnityEngine.Object resource = AssetDatabase.LoadAssetAtPath(realPath[0], typeof(GameObject));
 			return resource;
+#else
+			return null;
+#endif
 		}
 	}
 }