/*
 * @Author: 卢景滔
 * @Date: 2021-06-11 12:45:11
 * @LastEditTime: 2021-06-11 14:06:34
 * @LastEditors: 卢景滔
 * @Description: 
 */

import { _decorator, Component, Node, director, AudioSource, game } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Script')
export class Script extends Component {
    @property(AudioSource)
    readonly music:AudioSource = null!

    start () {
        game.addPersistRootNode(this.node)
        console.log(11);
    }

    musicPlay(){
        this.music.play()
    }

    musicPause(){
        this.music.pause()
    }

    gotoSence1(){
        director.loadScene('场景1')
    }

    gotoSence2(){
        director.loadScene('场景2')
    }
}

