cc.Class({
extends: cc.Component,
properties: {
},
// use this for initialization
onLoad: function () {
var self = this;
cc.loader.loadRes("prefab/Player", function (err, prefab) {
let myself = cc.instantiate(prefab);
myself.parent = self;
// or self.addChild(myself);
});
},
});
场景上面并没有显示出来?
无论是设置parent还是 addChild
parent is undefine
self.addChild is not a function