提交 586f26d4 编写于 作者: T tanghai

修复打包报错的问题

上级 abdb743c
...@@ -7,9 +7,13 @@ namespace Model ...@@ -7,9 +7,13 @@ namespace Model
{ {
public static UnityEngine.Object LoadResource(string bundleName, string prefab) public static UnityEngine.Object LoadResource(string bundleName, string prefab)
{ {
#if UNITY_EDITOR
string[] realPath = AssetDatabase.GetAssetPathsFromAssetBundleAndAssetName(bundleName.ToLower() + ".unity3d", prefab); string[] realPath = AssetDatabase.GetAssetPathsFromAssetBundleAndAssetName(bundleName.ToLower() + ".unity3d", prefab);
UnityEngine.Object resource = AssetDatabase.LoadAssetAtPath(realPath[0], typeof(GameObject)); UnityEngine.Object resource = AssetDatabase.LoadAssetAtPath(realPath[0], typeof(GameObject));
return resource; return resource;
#else
return null;
#endif
} }
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册