要件
- ボタンの仕掛けを設置する
- ボタンの仕掛けを押すとログとして押した回数を表示する
使用する仕掛け
- ボタンの仕掛け(x1)
使用する機能
- Print関数
回答
回答を見る
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
press_count_device := class(creative_device):
@editable
ButtonDevice:button_device = button_device{}
var PressCount:int = 0
OnBegin<override>()<suspends>:void=
ButtonDevice.InteractedWithEvent.Subscribe(OnInteract)
OnInteract(Agent:agent):void=
set PressCount += 1
Print("押した回数: {PressCount}")