獲取滑鼠左鍵點選 creator 3.8

流星曳尾發表於2024-09-11
start() {
  input.on(Input.EventType.MOUSE_DOWN, this.onMouseDown, this);
}
onMouseDown(event: EventMouse) {
switch (event.getButton()) {
case EventMouse.BUTTON_LEFT:
console.log('BUTTON_LEFT');
break;
}
}

相關文章