- Creator 版本:2.3.3
對於延遲和繼承的用法之請教~
出現錯誤: Cannot read property ‘function的名稱’ of null
Game.js
var Game = cc.Class({
properties: () => ({
item: {
default: null,
type: require("Item")
}
}),
start(){
this.item.FuncB() // 請問這樣呼叫有錯誤嗎?
},
FuncA(){
cc.log("AAA")
},
});
module.exports = Game;
Item.js
var Item = cc.Class({
properties: () => ({
game: {
default: null,
type: require("Game")
}
}),
start(){
this.game.FuncA() // 請問這樣呼叫有錯誤嗎?
},
FuncB(){
cc.log("BBB")
},
});
module.exports = Item;
請個位幫忙解惑 謝謝
