Browse Source

Added typing sounds and fixed pausing audio when typing pauses.

master
chrisgregan 10 years ago
parent
commit
bcfb70c0e6
  1. 5
      Assets/Examples/TheHunter/Audio/Typing.meta
  2. BIN
      Assets/Examples/TheHunter/Audio/Typing/AngryGiantInsect.wav
  3. 12
      Assets/Examples/TheHunter/Audio/Typing/AngryGiantInsect.wav.meta
  4. BIN
      Assets/Examples/TheHunter/Audio/Typing/JamesEarlJBot.wav
  5. 12
      Assets/Examples/TheHunter/Audio/Typing/JamesEarlJBot.wav.meta
  6. BIN
      Assets/Examples/TheHunter/Audio/Typing/JiminyC.wav
  7. 12
      Assets/Examples/TheHunter/Audio/Typing/JiminyC.wav.meta
  8. BIN
      Assets/Examples/TheHunter/Audio/Typing/RobotGossip.wav
  9. 12
      Assets/Examples/TheHunter/Audio/Typing/RobotGossip.wav.meta
  10. BIN
      Assets/Examples/TheHunter/Audio/Typing/SkeletalType.wav
  11. 12
      Assets/Examples/TheHunter/Audio/Typing/SkeletalType.wav.meta
  12. BIN
      Assets/Examples/TheHunter/Audio/Typing/SlightlyAnnoyedComputer.wav
  13. 12
      Assets/Examples/TheHunter/Audio/Typing/SlightlyAnnoyedComputer.wav.meta
  14. BIN
      Assets/Examples/TheHunter/Audio/Typing/SqueakyExplanation.wav
  15. 12
      Assets/Examples/TheHunter/Audio/Typing/SqueakyExplanation.wav.meta
  16. BIN
      Assets/Examples/TheHunter/Audio/Typing/UnderwaterMorse.wav
  17. 12
      Assets/Examples/TheHunter/Audio/Typing/UnderwaterMorse.wav.meta
  18. 23
      Assets/Examples/TheHunter/TheHunter.unity
  19. 126
      Assets/Examples/iTween/iTween.unity
  20. 13
      Assets/Fungus/Dialog/Scripts/Dialog.cs

5
Assets/Examples/TheHunter/Audio/Typing.meta

@ -0,0 +1,5 @@
fileFormatVersion: 2
guid: a2b97d7ad7737420cb35a06428d9c466
folderAsset: yes
DefaultImporter:
userData:

BIN
Assets/Examples/TheHunter/Audio/Typing/AngryGiantInsect.wav

Binary file not shown.

12
Assets/Examples/TheHunter/Audio/Typing/AngryGiantInsect.wav.meta

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 6ef46b89a24b74a14afd5145a28fc4fc
AudioImporter:
serializedVersion: 4
format: -1
quality: .5
stream: 1
3D: 0
forceToMono: 0
useHardware: 0
loopable: 0
userData:

BIN
Assets/Examples/TheHunter/Audio/Typing/JamesEarlJBot.wav

Binary file not shown.

12
Assets/Examples/TheHunter/Audio/Typing/JamesEarlJBot.wav.meta

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 0dc7e509ace954462bc8ab20fcb68d60
AudioImporter:
serializedVersion: 4
format: -1
quality: .5
stream: 1
3D: 0
forceToMono: 0
useHardware: 0
loopable: 0
userData:

BIN
Assets/Examples/TheHunter/Audio/Typing/JiminyC.wav

Binary file not shown.

12
Assets/Examples/TheHunter/Audio/Typing/JiminyC.wav.meta

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 124184555ec434aa68814be3bd116c26
AudioImporter:
serializedVersion: 4
format: -1
quality: .5
stream: 1
3D: 0
forceToMono: 0
useHardware: 0
loopable: 0
userData:

BIN
Assets/Examples/TheHunter/Audio/Typing/RobotGossip.wav

Binary file not shown.

12
Assets/Examples/TheHunter/Audio/Typing/RobotGossip.wav.meta

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: a7623e252b6a74db79eee3c71b710924
AudioImporter:
serializedVersion: 4
format: -1
quality: .5
stream: 1
3D: 0
forceToMono: 0
useHardware: 0
loopable: 0
userData:

BIN
Assets/Examples/TheHunter/Audio/Typing/SkeletalType.wav

Binary file not shown.

12
Assets/Examples/TheHunter/Audio/Typing/SkeletalType.wav.meta

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 5a3c8e205638142dcb8227abe5f14f1f
AudioImporter:
serializedVersion: 4
format: -1
quality: .5
stream: 1
3D: 0
forceToMono: 0
useHardware: 0
loopable: 0
userData:

BIN
Assets/Examples/TheHunter/Audio/Typing/SlightlyAnnoyedComputer.wav

Binary file not shown.

12
Assets/Examples/TheHunter/Audio/Typing/SlightlyAnnoyedComputer.wav.meta

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 9b3be2062b59848a2bd178f5748b386d
AudioImporter:
serializedVersion: 4
format: -1
quality: .5
stream: 1
3D: 0
forceToMono: 0
useHardware: 0
loopable: 0
userData:

BIN
Assets/Examples/TheHunter/Audio/Typing/SqueakyExplanation.wav

Binary file not shown.

12
Assets/Examples/TheHunter/Audio/Typing/SqueakyExplanation.wav.meta

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 23e52ab29f28743309c85b6d7bdc8ad6
AudioImporter:
serializedVersion: 4
format: -1
quality: .5
stream: 1
3D: 0
forceToMono: 0
useHardware: 0
loopable: 0
userData:

BIN
Assets/Examples/TheHunter/Audio/Typing/UnderwaterMorse.wav

Binary file not shown.

12
Assets/Examples/TheHunter/Audio/Typing/UnderwaterMorse.wav.meta

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: d51030c566c134c038723aab62eeb832
AudioImporter:
serializedVersion: 4
format: -1
quality: .5
stream: 1
3D: 0
forceToMono: 0
useHardware: 0
loopable: 0
userData:

23
Assets/Examples/TheHunter/TheHunter.unity

@ -1649,8 +1649,8 @@ MonoBehaviour:
- {fileID: 541676553} - {fileID: 541676553}
- {fileID: 541676556} - {fileID: 541676556}
- {fileID: 541676552} - {fileID: 541676552}
- {fileID: 541676558}
- {fileID: 541676551} - {fileID: 541676551}
- {fileID: 541676558}
- {fileID: 541676557} - {fileID: 541676557}
--- !u!4 &541676555 --- !u!4 &541676555
Transform: Transform:
@ -3220,7 +3220,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
writingSpeed: 60 writingSpeed: 60
writingSound: {fileID: 0} writingSound: {fileID: 8300000, guid: 5a3c8e205638142dcb8227abe5f14f1f, type: 3}
loopWritingSound: 1 loopWritingSound: 1
punctuationPause: .400000006 punctuationPause: .400000006
dialogCanvas: {fileID: 140463388} dialogCanvas: {fileID: 140463388}
@ -3305,6 +3305,10 @@ Prefab:
propertyPath: m_IsActive propertyPath: m_IsActive
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 11400004, guid: ffe6272c05a0840d1b4b07028163f170, type: 2}
propertyPath: writingSound
value:
objectReference: {fileID: 8300000, guid: 5a3c8e205638142dcb8227abe5f14f1f, type: 3}
m_RemovedComponents: [] m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: ffe6272c05a0840d1b4b07028163f170, type: 2} m_ParentPrefab: {fileID: 100100000, guid: ffe6272c05a0840d1b4b07028163f170, type: 2}
m_RootGameObject: {fileID: 1185554285} m_RootGameObject: {fileID: 1185554285}
@ -3424,7 +3428,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
writingSpeed: 60 writingSpeed: 60
writingSound: {fileID: 0} writingSound: {fileID: 8300000, guid: 5a3c8e205638142dcb8227abe5f14f1f, type: 3}
loopWritingSound: 1 loopWritingSound: 1
punctuationPause: .400000006 punctuationPause: .400000006
dialogCanvas: {fileID: 655392669} dialogCanvas: {fileID: 655392669}
@ -5782,7 +5786,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
scrollPos: {x: 377.652466, y: 514.8302} scrollPos: {x: 348.627258, y: 535.06012}
zoom: 1 zoom: 1
scrollViewRect: scrollViewRect:
serializedVersion: 2 serializedVersion: 2
@ -5790,8 +5794,9 @@ MonoBehaviour:
y: -883.033203 y: -883.033203
width: 1939.01758 width: 1939.01758
height: 1972.5332 height: 1972.5332
selectedSequence: {fileID: 0} selectedSequence: {fileID: 541676554}
selectedCommands: [] selectedCommands:
- {fileID: 541676551}
variables: variables:
- {fileID: 1831099569} - {fileID: 1831099569}
startSequence: {fileID: 1507034365} startSequence: {fileID: 1507034365}
@ -6066,6 +6071,10 @@ Prefab:
value: value:
objectReference: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9, objectReference: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9,
type: 3} type: 3}
- target: {fileID: 11400006, guid: 00974f07e5b9248d48d344335b83f4bd, type: 2}
propertyPath: writingSound
value:
objectReference: {fileID: 8300000, guid: 5a3c8e205638142dcb8227abe5f14f1f, type: 3}
m_RemovedComponents: [] m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: 00974f07e5b9248d48d344335b83f4bd, type: 2} m_ParentPrefab: {fileID: 100100000, guid: 00974f07e5b9248d48d344335b83f4bd, type: 2}
m_RootGameObject: {fileID: 1070206232} m_RootGameObject: {fileID: 1070206232}
@ -6430,7 +6439,7 @@ MonoBehaviour:
This way, follow me!' This way, follow me!'
character: {fileID: 338947448} character: {fileID: 338947448}
sayDialog: {fileID: 1185554287} sayDialog: {fileID: 1070206234}
voiceOverClip: {fileID: 0} voiceOverClip: {fileID: 0}
showOnce: 0 showOnce: 0
--- !u!114 &2111357061 --- !u!114 &2111357061

126
Assets/Examples/iTween/iTween.unity

@ -158,97 +158,6 @@ Transform:
m_Children: [] m_Children: []
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
--- !u!1 &427649606
GameObject:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 4
m_Component:
- 4: {fileID: 427649610}
- 114: {fileID: 427649609}
- 114: {fileID: 427649608}
- 114: {fileID: 427649607}
m_Layer: 0
m_Name: _CommandCopyBuffer
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &427649607
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 427649606}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 665e8847cab3749f597622c6c52997ad, type: 3}
m_Name:
m_EditorClassIdentifier:
errorMessage:
indentLevel: 0
target: {fileID: 1621124268}
tweenName:
duration: 1
easeType: 2
loopType: 0
waitUntilFinished: 1
toTransform: {fileID: 0}
toScale: {x: .5, y: .5, z: 0}
--- !u!114 &427649608
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 427649606}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 665e8847cab3749f597622c6c52997ad, type: 3}
m_Name:
m_EditorClassIdentifier:
errorMessage:
indentLevel: 0
target: {fileID: 1621124268}
tweenName:
duration: 1
easeType: 2
loopType: 0
waitUntilFinished: 1
toTransform: {fileID: 0}
toScale: {x: .5, y: .5, z: 0}
--- !u!114 &427649609
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 427649606}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 28859462f29464188bb29cc9f1f6e92c, type: 3}
m_Name:
m_EditorClassIdentifier:
nodeRect:
serializedVersion: 2
x: 10
y: 10
width: 100
height: 20
sequenceName: New Sequence
commandList: []
--- !u!4 &427649610
Transform:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 427649606}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
--- !u!1 &497781871 --- !u!1 &497781871
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -322,6 +231,7 @@ GameObject:
- 114: {fileID: 868139011} - 114: {fileID: 868139011}
- 114: {fileID: 868139012} - 114: {fileID: 868139012}
- 114: {fileID: 868139013} - 114: {fileID: 868139013}
- 114: {fileID: 868139014}
m_Layer: 0 m_Layer: 0
m_Name: FungusScript m_Name: FungusScript
m_TagString: Untagged m_TagString: Untagged
@ -367,7 +277,7 @@ MonoBehaviour:
x: 60 x: 60
y: 60 y: 60
width: 240 width: 240
height: 434 height: 454
sequenceName: Test iTween sequenceName: Test iTween
commandList: commandList:
- {fileID: 868138995} - {fileID: 868138995}
@ -390,6 +300,7 @@ MonoBehaviour:
- {fileID: 868139003} - {fileID: 868139003}
- {fileID: 868139007} - {fileID: 868139007}
- {fileID: 868139006} - {fileID: 868139006}
- {fileID: 868139014}
--- !u!114 &868138993 --- !u!114 &868138993
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -401,17 +312,16 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
scrollPos: {x: 171, y: -80} scrollPos: {x: 163, y: -41}
zoom: 1 zoom: 1
scrollViewRect: scrollViewRect:
serializedVersion: 2 serializedVersion: 2
x: -350 x: -350
y: -350 y: -350
width: 1050 width: 1050
height: 1244 height: 1284
selectedSequence: {fileID: 868138992} selectedSequence: {fileID: 0}
selectedCommands: selectedCommands: []
- {fileID: 868139013}
variables: [] variables: []
startSequence: {fileID: 868138992} startSequence: {fileID: 868138992}
executeOnStart: 1 executeOnStart: 1
@ -833,6 +743,28 @@ MonoBehaviour:
loopType: 0 loopType: 0
waitUntilFinished: 1 waitUntilFinished: 1
amount: {x: 1, y: 1, z: 0} amount: {x: 1, y: 1, z: 0}
--- !u!114 &868139014
MonoBehaviour:
m_ObjectHideFlags: 2
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 868138990}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 433657382cf894ff2973ee118eed40ea, type: 3}
m_Name:
m_EditorClassIdentifier:
errorMessage:
indentLevel: 0
target: {fileID: 1621124268}
tweenName:
duration: 1
easeType: 2
loopType: 0
waitUntilFinished: 1
fromTransform: {fileID: 1955612100}
fromPosition: {x: 0, y: 0, z: 0}
axis: 3
--- !u!1 &1090256565 --- !u!1 &1090256565
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

13
Assets/Fungus/Dialog/Scripts/Dialog.cs

@ -232,7 +232,9 @@ namespace Fungus
if (!skipCharacter) if (!skipCharacter)
{ {
typingAudio.audio.Pause();
yield return new WaitForSeconds(currentPunctuationPause); yield return new WaitForSeconds(currentPunctuationPause);
typingAudio.audio.Play();
} }
} }
@ -269,20 +271,31 @@ namespace Fungus
{ {
duration = 1f; duration = 1f;
} }
typingAudio.audio.Pause();
yield return new WaitForSeconds(duration); yield return new WaitForSeconds(duration);
typingAudio.audio.Play();
timeAccumulator = 0f; timeAccumulator = 0f;
break; break;
case GlyphType.WaitForInputNoClear: case GlyphType.WaitForInputNoClear:
OnWaitForInputTag(true); OnWaitForInputTag(true);
typingAudio.audio.Pause();
yield return StartCoroutine(WaitForInput(null)); yield return StartCoroutine(WaitForInput(null));
typingAudio.audio.Play();
timeAccumulator = 0f; timeAccumulator = 0f;
OnWaitForInputTag(false); OnWaitForInputTag(false);
break; break;
case GlyphType.WaitForInputAndClear: case GlyphType.WaitForInputAndClear:
OnWaitForInputTag(true); OnWaitForInputTag(true);
typingAudio.audio.Pause();
yield return StartCoroutine(WaitForInput(null)); yield return StartCoroutine(WaitForInput(null));
typingAudio.audio.Play();
OnWaitForInputTag(false); OnWaitForInputTag(false);
timeAccumulator = 0f; timeAccumulator = 0f;
storyText.text = ""; storyText.text = "";

Loading…
Cancel
Save