I’m trying to load assets from resources folder using resources.load
in Cocos Creator 3.5. But when I run the project there is an error “Bundle resources doesn’t contain apel”.
This is my code to load assets
import { _decorator, Component, Sprite, resources, SpriteFrame, error } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('MainMenu')
export class MainMenu extends Component {
@property(Sprite)
attachedNode: Sprite = null;
start() {
resources.load('apel', SpriteFrame, (err, spriteFrame) => {
if (err) {
error(err.message);
return;
}
this.attachedNode.spriteFrame = spriteFrame;
});
}
}
and this is the contents of resources folder
I’ve tried to build the project but the result is still same. Has anyone experienced this and what is the solution? Thanks before.