获取鼠标左键点击 creator 3.8

    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;
        }
    }
posted @ 2024-09-11 14:34  流星曳尾  阅读(21)  评论(0编辑  收藏  举报