In my game, I would like the player to be able to place audio files(.mp3/ .ogg) into their documents and for the game to play that music in the background.
Please explain thoroughly as I would like to build onto this!
In my game, I would like the player to be able to place audio files(.mp3/ .ogg) into their documents and for the game to play that music in the background.
Please explain thoroughly as I would like to build onto this!
You would probably have to do a script where it detects a name of a file, so you will have to tell the customers that you have to name the file of a certain name so it will work.
try this
#pragma strict
funtion Update () {
if (System.IO.File.Exists("sound.mp3"))
{
audio.Play("sound.mp3")
}
}
So what you’ll have to do is wherever it says sound.mp3, you should type the directory where the game is going to be stored and the file name of the sound. So it may look like
C:/ProgramData/Game/Assets/sound.mp3
instead of just sound.mp3.
It may work or it may not work.