@cc-component/cc-core 1.5.2 → 1.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -191,8 +191,9 @@ export class ResourceManager {
191
191
  path = path.replace("/spriteFrame", "")
192
192
  return `${bundleName}:${path}`;
193
193
  }
194
- public getAssetPath(node: Asset) {
195
- return node.asset_path.split(':').pop()
194
+ public getAssetPath(node: Node) {
195
+ if (node && node.isValid) return node.asset_path.split(':').pop()
196
+ return ''
196
197
  }
197
198
 
198
199
  LogAssets(bundleName: string) {
@@ -251,6 +251,10 @@ declare module "cc" {
251
251
  /**资源路径 */
252
252
  asset_path: string;
253
253
  }
254
+ interface Node {
255
+ /**资源路径 */
256
+ asset_path: string;
257
+ }
254
258
  }
255
259
  /**
256
260
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cc-component/cc-core",
3
- "version": "1.5.2",
3
+ "version": "1.5.4",
4
4
  "engine": ">=3.8.6",
5
5
  "description": "系统组件添加常用扩展方法",
6
6
  "main": "index.ts",