12345 |
- {
- "code": "export var VoiceType;\r\n(function (VoiceType) {\r\n VoiceType[VoiceType[\"boom\"] = 0] = \"boom\";\r\n VoiceType[VoiceType[\"cut\"] = 1] = \"cut\";\r\n VoiceType[VoiceType[\"cutgrass\"] = 2] = \"cutgrass\";\r\n VoiceType[VoiceType[\"lose\"] = 3] = \"lose\";\r\n VoiceType[VoiceType[\"win\"] = 4] = \"win\";\r\n})(VoiceType || (VoiceType = {}));\r\nexport var BgmType;\r\n(function (BgmType) {\r\n BgmType[BgmType[\"bgm\"] = 0] = \"bgm\";\r\n})(BgmType || (BgmType = {}));\r\nexport class AudioControl {\r\n static voiceres(_type) {\r\n return \"subpackage/res/sound/\" + VoiceType[_type] + \".mp3\";\r\n }\r\n static PlayVoice(_type, _loop = false) {\r\n if (!this.play)\r\n return;\r\n var loop = _loop ? 0 : 1;\r\n Laya.SoundManager.playSound(this.voiceres(_type), loop);\r\n }\r\n static ClearAudio() {\r\n Laya.SoundManager.stopAllSound();\r\n }\r\n static bgmres(_type) {\r\n return \"subpackage/res/sound/\" + BgmType[_type] + \".mp3\";\r\n }\r\n static PlayBgm(_type, _loop = true) {\r\n if (!this.play)\r\n return;\r\n var loop = _loop ? 0 : 1;\r\n Laya.SoundManager.playMusic(this.bgmres(_type), loop);\r\n }\r\n static ClearBgm() {\r\n Laya.SoundManager.stopMusic();\r\n }\r\n}\r\nAudioControl.play = true;\r\n",
- "references": []
- }
|