3.4.1
resources.load ScriptFrame 抓不到檔案
但是讀取資料夾resources.loadDir是可以的
-
Creator 版本: 3.4.1
-
目标平台:win chrome浏览器 開發網頁
-
重现方式:
- 设置Init.ts / 丢到场景里
- resources/jpgfile1.jpg 放张图片
- 运行预览
import { _decorator, Component, Node, resources, SpriteFrame, Sprite } from 'cc'
const { ccclass, property } = _decorator
@ccclass('Init')
export class Init extends Component {
start() {
resources.load('jpgfile1', SpriteFrame, function (err, spriteFrame) {
console.log('err', err)
console.log('spriteFrame', spriteFrame)
})
}
}
- 首个报错:
err Error: Bundle resources doesn't contain jpgfile1
at _loop (index.js:93707:25)
at parse (index.js:93784:18)
at Pipeline.sync (index.js:92392:26)
at preprocess (index.js:92711:53)
at Pipeline._flow (index.js:92447:11)
at Pipeline.async (index.js:92440:16)
at AssetManager.loadAny (index.js:86807:20)
at Bundle.load (index.js:87290:33)
at Init.start (Init.js:26:21)
at index.js:150321:16
- 编辑器操作系统: windows
- 重现概率:100%
