SelectLevel.ts 444 B

12345678910111213141516171819
  1. import { _decorator, Button, Component, Node, director } from 'cc';
  2. const { ccclass, property } = _decorator;
  3. @ccclass('SelectLevel')
  4. export class SelectLevel extends Component {
  5. start() {
  6. let BtnStart = this.node.getChildByName("BtnStart");
  7. BtnStart.on(Button.EventType.CLICK,this.onBtnStart,this);
  8. }
  9. onBtnStart(){
  10. director.loadScene("MainScene");
  11. }
  12. update(deltaTime: number) {
  13. }
  14. }