import AudioM from "./AudioM";

const { ccclass, property } = cc._decorator;

@ccclass
export default class game extends cc.Component {

    @property(cc.Label)
    label: cc.Label = null;

    @property
    text: string = 'game scene';


    start() {
        // init logic
        this.label.string = this.text;
        if (AudioM.getIns().canPlayMusic) {
            AudioM.getIns().playMusic('bg_2');
        }
        this.playAudio();
    }


    playAudio() {
        for (let i = 0; i < 5; i++) {
            AudioM.getIns().playClick();
            AudioM.getIns().playClose();
        }
    }

    outGame() {
        cc.director.loadScene('helloworld');
    }
}
