diff --git a/Assets/Fungus/Dialog/Commands/Choose.cs b/Assets/Fungus/Dialog/Commands/Choose.cs index e8e049d5..22942f96 100644 --- a/Assets/Fungus/Dialog/Commands/Choose.cs +++ b/Assets/Fungus/Dialog/Commands/Choose.cs @@ -22,6 +22,7 @@ namespace Fungus.Script public string chooseText; public Character character; + public AudioClip voiceOverClip; public float timeoutDuration; bool showBasicGUI; @@ -81,6 +82,11 @@ namespace Fungus.Script options.Clear(); + if (voiceOverClip != null) + { + MusicController.GetInstance().PlaySound(voiceOverClip, 1f); + } + dialog.Choose(chooseText, dialogOptions, timeoutDuration, delegate { dialog.ShowDialog(false); Continue(); diff --git a/Assets/Fungus/Dialog/Commands/Say.cs b/Assets/Fungus/Dialog/Commands/Say.cs index bdc3814d..8f91a5d3 100644 --- a/Assets/Fungus/Dialog/Commands/Say.cs +++ b/Assets/Fungus/Dialog/Commands/Say.cs @@ -15,6 +15,7 @@ namespace Fungus.Script public Character character; public string storyText; + public AudioClip voiceOverClip; public bool showOnce; int executionCount; @@ -52,6 +53,11 @@ namespace Fungus.Script dialog.SetCharacter(character); + if (voiceOverClip != null) + { + MusicController.GetInstance().PlaySound(voiceOverClip, 1f); + } + dialog.Say(storyText, delegate { dialog.ShowDialog(false); Continue(); diff --git a/Assets/Fungus/Dialog/Editor/ChooseEditor.cs b/Assets/Fungus/Dialog/Editor/ChooseEditor.cs index 271ecc40..18c85035 100644 --- a/Assets/Fungus/Dialog/Editor/ChooseEditor.cs +++ b/Assets/Fungus/Dialog/Editor/ChooseEditor.cs @@ -30,6 +30,11 @@ namespace Fungus.Script new GUIContent(""), t.dialog); + AudioClip voiceOverClip = EditorGUILayout.ObjectField(new GUIContent("Voice Over Clip", "Voice over audio to play when the choose text is displayed"), + t.voiceOverClip, + typeof(AudioClip), + true) as AudioClip; + float timeoutDuration = EditorGUILayout.FloatField(new GUIContent("Timeout Duration", "Time limit for player to make a choice. Set to 0 for no limit."), t.timeoutDuration); if (EditorGUI.EndChangeCheck()) @@ -38,6 +43,7 @@ namespace Fungus.Script t.chooseText = chooseText; t.character = character; t.dialog = dialog; + t.voiceOverClip = voiceOverClip; t.timeoutDuration = timeoutDuration; } } diff --git a/Assets/Fungus/Dialog/Editor/SayEditor.cs b/Assets/Fungus/Dialog/Editor/SayEditor.cs index 793bfe21..d6c323bb 100644 --- a/Assets/Fungus/Dialog/Editor/SayEditor.cs +++ b/Assets/Fungus/Dialog/Editor/SayEditor.cs @@ -53,6 +53,11 @@ namespace Fungus.Script new GUIContent(""), t.dialog); + AudioClip voiceOverClip = EditorGUILayout.ObjectField(new GUIContent("Voice Over Clip", "Voice over audio to play when the say text is displayed"), + t.voiceOverClip, + typeof(AudioClip), + true) as AudioClip; + bool showOnce = EditorGUILayout.Toggle(new GUIContent("Show Once", "Show this text once and never show it again."), t.showOnce); if (EditorGUI.EndChangeCheck()) @@ -61,6 +66,7 @@ namespace Fungus.Script t.storyText = text; t.character = character; t.dialog = dialog; + t.voiceOverClip = voiceOverClip; t.showOnce = showOnce; } } diff --git a/Assets/Shuttle/Destiny.mp3 b/Assets/Shuttle/Destiny.mp3 new file mode 100644 index 00000000..77e38130 Binary files /dev/null and b/Assets/Shuttle/Destiny.mp3 differ diff --git a/Assets/Shuttle/Destiny.mp3.meta b/Assets/Shuttle/Destiny.mp3.meta new file mode 100644 index 00000000..36e5f29a --- /dev/null +++ b/Assets/Shuttle/Destiny.mp3.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8433d11ae0a444319b220751cd17efec +AudioImporter: + serializedVersion: 4 + format: 0 + quality: .5 + stream: 1 + 3D: 0 + forceToMono: 0 + useHardware: 0 + loopable: 0 + userData: diff --git a/Assets/Shuttle/ShuttleGame.unity b/Assets/Shuttle/ShuttleGame.unity index 4b617b6b..b140ce07 100644 Binary files a/Assets/Shuttle/ShuttleGame.unity and b/Assets/Shuttle/ShuttleGame.unity differ diff --git a/Assets/Shuttle/Welcome.mp3 b/Assets/Shuttle/Welcome.mp3 new file mode 100644 index 00000000..0b735bd8 Binary files /dev/null and b/Assets/Shuttle/Welcome.mp3 differ diff --git a/Assets/Shuttle/Welcome.mp3.meta b/Assets/Shuttle/Welcome.mp3.meta new file mode 100644 index 00000000..e1f89da8 --- /dev/null +++ b/Assets/Shuttle/Welcome.mp3.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: aa3edbfe1ff8f43ef97d0f4b5ad341f0 +AudioImporter: + serializedVersion: 4 + format: 0 + quality: .170000002 + stream: 1 + 3D: 0 + forceToMono: 0 + useHardware: 0 + loopable: 0 + userData: