Commit ef1f1c35 authored by 智慧's avatar 智慧

feat:本地加载图片无论如何都加载不上,明天问一下。我把图片放在resources下面了

parent 53d09435
......@@ -24,9 +24,10 @@ export default class EnemyControl extends cc.Component {
die() {
this.isDie = true;
//动态加载图片
// cc.loader.loadRes("enemy1_die", cc.SpriteFrame, (err, res) => {
// this.node.getComponent(cc.Sprite).spriteFrame = res;
// });
cc.loader.loadRes("enemy1_die", cc.SpriteFrame, (err, res) => {
this.node.getComponent(cc.Sprite).spriteFrame = res;
});
// 300毫秒后销毁
setTimeout(() => {
this.node.destroy();
......
{
"ver": "1.1.2",
"uuid": "8b6decaa-59d3-4bac-9ad1-8bb6941249eb",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {},
"subMetas": {}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment