Blame view

ios/Runner/Wowgame/Classes/game_food/SoundUtils.cpp 725 Bytes
cb213901   xiaoyu   添加一个游戏的源码和编译选项
1
2
3
4
5
6
7
8
9
10
11
12
  //
  //  SoundUtils.cpp
  //  SteveMaggieCpp
  //
  //  Created by Katarzyna Kalinowska-Górska on 10.05.2017.
  //
  //
  
  #include "SoundUtils.h"
  #include "MathUtils.h"
  #include "SoundsRepo.h"
  
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
13
      unsigned int SoundUtils::playRandomSound(std::string soundFolderPath, std::vector<std::string> soundNames, bool stopEffects){
cb213901   xiaoyu   添加一个游戏的源码和编译选项
14
15
16
17
18
19
20
21
22
23
      
          auto soundsLength = soundNames.size();
          if(soundsLength > 0){
              int randomIndex = MathUtils::getRandomInt(0, (int)soundsLength-1);
              std::string fullSoundPath = soundFolderPath == "" ? soundNames[randomIndex] : soundFolderPath /*+ "/"*/ + soundNames[randomIndex];
              return SoundsRepo::playSound(fullSoundPath, stopEffects);
          }
      
          return 0;
      }