12 changed files with 238 additions and 0 deletions
Binary file not shown.
@ -0,0 +1,5 @@ |
|||||||
|
fileFormatVersion: 2 |
||||||
|
guid: 23916e2f1deff4e31a36b6e75aed0906 |
||||||
|
folderAsset: yes |
||||||
|
DefaultImporter: |
||||||
|
userData: |
Binary file not shown.
@ -0,0 +1,12 @@ |
|||||||
|
fileFormatVersion: 2 |
||||||
|
guid: 5446370c736a84b6d9d6a9bb6f4d4521 |
||||||
|
AudioImporter: |
||||||
|
serializedVersion: 4 |
||||||
|
format: 0 |
||||||
|
quality: .5 |
||||||
|
stream: 1 |
||||||
|
3D: 0 |
||||||
|
forceToMono: 0 |
||||||
|
useHardware: 0 |
||||||
|
loopable: 0 |
||||||
|
userData: |
Binary file not shown.
@ -0,0 +1,12 @@ |
|||||||
|
fileFormatVersion: 2 |
||||||
|
guid: 81d2b469d3efe4fd9838d3a4f5165bee |
||||||
|
AudioImporter: |
||||||
|
serializedVersion: 4 |
||||||
|
format: 0 |
||||||
|
quality: .5 |
||||||
|
stream: 2 |
||||||
|
3D: 0 |
||||||
|
forceToMono: 0 |
||||||
|
useHardware: 0 |
||||||
|
loopable: 0 |
||||||
|
userData: |
Binary file not shown.
@ -0,0 +1,65 @@ |
|||||||
|
using UnityEngine; |
||||||
|
using System.Collections; |
||||||
|
using Fungus; |
||||||
|
|
||||||
|
public class AudioRoom : Room |
||||||
|
{ |
||||||
|
public Room menuRoom; |
||||||
|
public AudioClip musicClip; |
||||||
|
public AudioClip effectClip; |
||||||
|
|
||||||
|
void OnEnter() |
||||||
|
{ |
||||||
|
if (GetFlag("music")) |
||||||
|
{ |
||||||
|
AddOption("Stop the music", StopMusic); |
||||||
|
|
||||||
|
if (GetFlag("quiet") == false) |
||||||
|
{ |
||||||
|
AddOption("Shhh! Make it quieter", MakeQuiet); |
||||||
|
} |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
AddOption("Play some music", StartMusic); |
||||||
|
} |
||||||
|
AddOption("Play a sound effect", PlaySound); |
||||||
|
AddOption("Back to menu", MainMenu); |
||||||
|
|
||||||
|
Choose("We are the music makers, and we are the dreamers of dreams."); |
||||||
|
} |
||||||
|
|
||||||
|
void StartMusic() |
||||||
|
{ |
||||||
|
PlayGameMusic(musicClip); |
||||||
|
SetMusicVolume(1f); |
||||||
|
SetFlag("music", true); |
||||||
|
Call(OnEnter); |
||||||
|
} |
||||||
|
|
||||||
|
void StopMusic() |
||||||
|
{ |
||||||
|
StopGameMusic(); |
||||||
|
SetFlag("music", false); |
||||||
|
SetFlag("quiet", false); |
||||||
|
Call(OnEnter); |
||||||
|
} |
||||||
|
|
||||||
|
void PlaySound() |
||||||
|
{ |
||||||
|
PlaySound(effectClip, 1f); |
||||||
|
Call(OnEnter); |
||||||
|
} |
||||||
|
|
||||||
|
void MakeQuiet() |
||||||
|
{ |
||||||
|
SetFlag("quiet", true); |
||||||
|
SetMusicVolume(0.25f, 1f); |
||||||
|
Call(OnEnter); |
||||||
|
} |
||||||
|
|
||||||
|
void MainMenu() |
||||||
|
{ |
||||||
|
MoveToRoom(menuRoom); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,8 @@ |
|||||||
|
fileFormatVersion: 2 |
||||||
|
guid: cf05e131525e5483ebe1ab66557e8824 |
||||||
|
MonoImporter: |
||||||
|
serializedVersion: 2 |
||||||
|
defaultReferences: [] |
||||||
|
executionOrder: 0 |
||||||
|
icon: {instanceID: 0} |
||||||
|
userData: |
Loading…
Reference in new issue