Roblox
如果你在 Roblox 上制作过游戏,要开始使用 All Out,你需要了解一些关键差异!
最后更新于
import "core:ao"
// 在编辑器中将此组件附加到实体。
Coin_Pickup :: class : Interactable {
coins: s64 @ao_serialize;
used: bool;
ao_start :: method() {
this.set_listener(this);
this.set_text("Collect");
radius = 1.25;
required_hold_time = 0.0;
}
can_use :: method(player: Player) -> bool {
return !used;
}
on_interact :: method(player: Player) {
if used return;
used = true;
Economy.deposit_currency(player, "Coins", coins);
entity.destroy();
}
}