所以我有這門課:
class Sigil {
constructor(name = "", type = "", func = (oppositeCard, oppositeCardLane) => { }) {
this.name = name;
this.type = type;
this.function = func
}
Activate(oppositeCard, oppositeCardLane) {
};
}
var fly = new Sigil("Fly", "OnAttack", (oppositeCard, oppositeCardLane) => {
oppositeCard = cardLib.blank;
return oppositeCard;
})
我想做的是使用我使用建構式放入的函式。所以就像我想使用 Activate 方法呼叫“func”函式
uj5u.com熱心網友回復:
您所做的就是呼叫this.function.
class Sigil {
...
Activate(){
this.function();
}
...
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/377442.html
標籤:节点.js
