import { _decorator, Component, Node, EventTouch } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Test')
export class Test extends Component {

    @property(Node)
    private button_1:Node;

    @property(Node)
    private button_2:Node;

    start() {
        this.button_1.on(Node.EventType.TOUCH_START,(event:EventTouch)=>
        {
            console.log("点击了按钮 ",this.button_1.name);
        });

        this.button_2.on(Node.EventType.TOUCH_START,(event:EventTouch)=>
        {
            console.log("点击了按钮 ",this.button_2.name);
        });
    }

    update(deltaTime: number) {
        
    }
}

