Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. // Called when the game starts
  2. void UIntelSoundComponent::BeginPlay()
  3. {
  4.     Super::BeginPlay();
  5.    
  6.     //UE4 way of managing files
  7.     IFileManager &fileManager = IFileManager::Get();
  8.    
  9.     //UE_LOG(LogTemp, Warning, TEXT("%s"), &fileManager);
  10.  
  11.    
  12.     if (exists == true){
  13.  
  14.         //Extensions to sound files. Was using .wav, but .uasset seems to work when there is and isn't an editor.
  15.         FString ext = "/*.wav";
  16.         FString ext2 = "/*.uasset";
  17.        
  18.         //path = FPaths::ProjectDir() + Content/Sounds + /*.uasset
  19.         FString path = soundDir + ext2;
  20.  
  21.         //This finds file in the given array, with the given path
  22.         //the true bool is saying to look for files while false bool is saying to not look for directories
  23.         fileManager.FindFiles(soundFiles, *path, true, false);