Browse Source

Renamed StartGameMusic to StartMusic and StopGameMusic to StopMusic

master
chrisgregan 11 years ago
parent
commit
0e36980c65
  1. 4
      Assets/Fungus/Scripts/GameController.cs
  2. 12
      Assets/FungusExample/Scripts/AudioRoom.cs

4
Assets/Fungus/Scripts/GameController.cs

@ -226,14 +226,14 @@ public class GameController : MonoBehaviour
} }
// Plays game music using an audio clip // Plays game music using an audio clip
public void PlayGameMusic(AudioClip audioClip) public void PlayMusic(AudioClip audioClip)
{ {
CommandQueue commandQueue = Game.GetInstance().commandQueue; CommandQueue commandQueue = Game.GetInstance().commandQueue;
commandQueue.AddCommand(new PlayMusicCommand(audioClip)); commandQueue.AddCommand(new PlayMusicCommand(audioClip));
} }
// Stops playing game music // Stops playing game music
public void StopGameMusic() public void StopMusic()
{ {
CommandQueue commandQueue = Game.GetInstance().commandQueue; CommandQueue commandQueue = Game.GetInstance().commandQueue;
commandQueue.AddCommand(new StopMusicCommand()); commandQueue.AddCommand(new StopMusicCommand());

12
Assets/FungusExample/Scripts/AudioRoom.cs

@ -12,7 +12,7 @@ public class AudioRoom : Room
{ {
if (GetFlag("music")) if (GetFlag("music"))
{ {
AddOption("Stop the music", StopMusic); AddOption("Stop the music", StopGameMusic);
if (GetFlag("quiet") == false) if (GetFlag("quiet") == false)
{ {
@ -21,7 +21,7 @@ public class AudioRoom : Room
} }
else else
{ {
AddOption("Play some music", StartMusic); AddOption("Play some music", StartGameMusic);
} }
AddOption("Play a sound effect", PlaySound); AddOption("Play a sound effect", PlaySound);
AddOption("Back to menu", MainMenu); AddOption("Back to menu", MainMenu);
@ -36,17 +36,17 @@ public class AudioRoom : Room
} }
} }
void StartMusic() void StartGameMusic()
{ {
PlayGameMusic(musicClip); PlayMusic(musicClip);
SetMusicVolume(1f); SetMusicVolume(1f);
SetFlag("music", true); SetFlag("music", true);
Call(OnEnter); Call(OnEnter);
} }
void StopMusic() void StopGameMusic()
{ {
StopGameMusic(); StopMusic();
SetFlag("music", false); SetFlag("music", false);
SetFlag("quiet", false); SetFlag("quiet", false);
Call(OnEnter); Call(OnEnter);

Loading…
Cancel
Save