export enum MusicType{click,hit,shoot,OpenView,Lose,Win,die}
export enum BGMType{BGM};
export  class AudioManager  {
    
    constructor() {  }
    public static open:boolean = true;

    private static musicres(_type:MusicType):string{
        return "Game/res/music/"+ MusicType[_type] + ".mp3";
    }
    private static bgmres(_type:BGMType):string{
        return "Game/res/music/"+BGMType[_type] + ".mp3";
    }
    //播放音效
    public static playMusic (_type:MusicType){
        if(!this.open)return;
        Laya.SoundManager.playSound(this.musicres(_type));
    }
    //暂停背景音乐
    public static StopMusic(){
        Laya.SoundManager.stopMusic();
    }
    //播放背景音乐
    public static PlayBGM(_type:BGMType){
        if(!this.open)return
        Laya.SoundManager.playMusic(this.bgmres(_type),0);
    }
}