BRTPSoundFun.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. },
  5. statics: {
  6. EFFECT_NUM: 3,
  7. AN_GANG_NUM_W: 2,
  8. RAW_KIND: "",
  9. GAME_BACKGRUAND: "game",//背景音乐
  10. EX_SCORE: "score",//金币动画声音
  11. EX_SENDCARD: "star",//发牌动画声音
  12. EX_SHOWCARD: "showCard",//显示牌动画声音
  13. EX_CHIPSTART: "beginBet",//开始下注
  14. EX_CHIPEND: "stopBet",//停止下注
  15. EX_GAME_WIN: "game_win",//赢
  16. EX_GAME_LOSE: "gameLose",//输
  17. EX_GAME_NO_BET: "gameNoBet",//
  18. EX_BETLOW: "score0",//
  19. EX_BETHIGH: "betHigh",//
  20. EX_TIME: "time",//倒计时声音
  21. EX_CHANGEBANKER: "changeBanker",
  22. LG_PATH_SC: "filter-BRTP/",
  23. LG_FLAG_SC: "local/",
  24. LG_FLAG_PT: "putong/",
  25. bgmAudioID: -1,
  26. setPuTong(puTong) {
  27. },
  28. playBackMusic(kName) {
  29. var path = this.LG_PATH_SC + kName;
  30. if (cc.vv && cc.vv.audioMgr) {
  31. this.bgmAudioID = cc.vv.audioMgr.playBGM(path);
  32. }
  33. },
  34. stopBackMusic() {
  35. if (cc.vv && cc.vv.audioMgr) {
  36. cc.vv.audioMgr.stopBackMusic();
  37. }
  38. },
  39. playEffect(kName, preload) {
  40. var path = this.LG_PATH_SC + this.LG_FLAG_PT + kName + this.RAW_KIND;
  41. if (cc.vv && cc.vv.audioMgr) {
  42. var audioID = cc.vv.audioMgr.playSFX(path);
  43. }
  44. },
  45. playEffectDefineString(kName, preload) {
  46. if (cc.vv && cc.vv.audioMgr) {
  47. var audioID = cc.vv.audioMgr.playSFX(kName);
  48. }
  49. },
  50. playCardTypeByGender(iGender, cardpoint) {
  51. var path = "";
  52. if (iGender > 0) {
  53. path = "man/" + "cow_" + cardpoint;
  54. } else {
  55. path = "woman/" + "cow_" + cardpoint;
  56. }
  57. return this.playEffect(path, false);
  58. },
  59. playTypeByGender(iGender, type) {
  60. var path = "";
  61. if (iGender > 0) {
  62. path = "man/" + "type_" + type;
  63. } else {
  64. path = "woman/" + "type_" + type;
  65. }
  66. return this.playEffect(path, false);
  67. },
  68. playEffectByGender(iGender, kName) {
  69. var path = "";
  70. if (iGender > 0) {
  71. path = "man/" + kName;
  72. } else {
  73. path = "woman/" + kName;
  74. }
  75. return this.playEffect(path, false);
  76. },
  77. playEffectEX(kName) {
  78. var path = this.LG_PATH_SC + "effect/" + kName + this.RAW_KIND;
  79. if (cc.vv && cc.vv.audioMgr) {
  80. var audioID = cc.vv.audioMgr.playSFX(path);
  81. }
  82. },
  83. getDefineSound(iGender, kStr) {
  84. var value = "fix_msg_" + kStr;
  85. var path = this.LG_PATH_SC;
  86. if (iGender > 0) {
  87. path += "talk/man/" + value + this.RAW_KIND;
  88. } else {
  89. path += "talk/woman/" + value + this.RAW_KIND;
  90. }
  91. return path;
  92. },
  93. },
  94. start() {
  95. },
  96. });