CachetaSoundFun.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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: "bgm2",//背景音乐
  10. WARNING: "alarm",//显示牌动画声音
  11. EX_BUTTON: "open",//
  12. EX_COUNTDOWN: "time",//倒计时声音
  13. GAME_START: "start_game",
  14. GAME_WIN: "game_win",
  15. GAME_LOSE: "lose",
  16. DIAN_PAO: "dianpao",
  17. SHUFFLE: "washcard1",
  18. SENDCARD: "washcard2",
  19. FLIPCARD: "flip card",
  20. CARD: "card",
  21. THROW_COIN: "bet",
  22. PICK_COIN: "coin",
  23. LG_PATH_SC: "",
  24. LG_FLAG_SC: "local/",
  25. LG_FLAG_PT: "putong/",
  26. bgmAudioID:-1,
  27. setPuTong(puTong) {
  28. },
  29. playBackMusic(kName) {
  30. var path = this.LG_PATH_SC + kName;
  31. if (cc.vv && cc.vv.audioMgr) {
  32. this.bgmAudioID = cc.vv.audioMgr.playBGM(path);
  33. }
  34. },
  35. stopBackMusic() {
  36. if (cc.vv && cc.vv.audioMgr) {
  37. cc.vv.audioMgr.stopBackMusic();
  38. }
  39. },
  40. playEffect(kName, preload) {
  41. var path = this.LG_PATH_SC + kName;
  42. if (cc.vv && cc.vv.audioMgr) {
  43. var audioID = cc.vv.audioMgr.playSFX(path);
  44. }
  45. },
  46. playEffectDefineString(kName, preload) {
  47. if (cc.vv && cc.vv.audioMgr) {
  48. var audioID = cc.vv.audioMgr.playSFX(kName);
  49. }
  50. },
  51. playCardTypeByGender(iGender, cardpoint) {
  52. var path = "";
  53. if (iGender > 0) {
  54. path = "man/" + "cow_" + cardpoint ;
  55. }else{
  56. path = "woman/" + "cow_" + cardpoint ;
  57. }
  58. return this.playEffect(path, false);
  59. },
  60. playTypeByGender(iGender, type) {
  61. var path = "";
  62. if (iGender > 0) {
  63. path = "man/" + "type_" + type ;
  64. }else{
  65. path = "woman/" + "type_" + type ;
  66. }
  67. return this.playEffect(path, false);
  68. },
  69. playEffectByGender(iGender, kName) {
  70. var path = "";
  71. if (iGender > 0) {
  72. path = "man/" + kName ;
  73. }else{
  74. path = "woman/" + kName ;
  75. }
  76. return this.playEffect(path, false);
  77. },
  78. playEffectEX(kName) {
  79. var path = this.LG_PATH_SC + "effect/" + kName;
  80. if (cc.vv && cc.vv.audioMgr) {
  81. var audioID = cc.vv.audioMgr.playSFX(path);
  82. }
  83. },
  84. getDefineSound(iGender, kStr) {
  85. var value = "fix_msg_" + kStr;
  86. var path = this.LG_PATH_SC;
  87. if (iGender > 0) {
  88. path += "talk/man/" + value + this.RAW_KIND;
  89. }else{
  90. path += "talk/woman/" + value + this.RAW_KIND;
  91. }
  92. return path;
  93. },
  94. },
  95. // LIFE-CYCLE CALLBACKS:
  96. // onLoad () {},
  97. start () {
  98. },
  99. // update (dt) {},
  100. });