Browse Source

Added 'Click Anywhere' property to Dialog component.

If Click Anywhere is false then the user may only click on the dialog
to continue.
master
chrisgregan 10 years ago
parent
commit
0954719c2c
  1. 622
      Assets/Examples/TheHunter/TheHunter.unity
  2. 5
      Assets/Fungus/Dialog/Audio.meta
  3. 0
      Assets/Fungus/Dialog/Audio/SkeletalType.wav
  4. 0
      Assets/Fungus/Dialog/Audio/SkeletalType.wav.meta
  5. 59
      Assets/Fungus/Dialog/Prefabs/ChooseDialog.prefab
  6. 56
      Assets/Fungus/Dialog/Prefabs/NarratorDialog.prefab
  7. 64
      Assets/Fungus/Dialog/Prefabs/SayDialog.prefab
  8. 28
      Assets/Fungus/Dialog/Scripts/Dialog.cs

622
Assets/Examples/TheHunter/TheHunter.unity

File diff suppressed because it is too large Load Diff

5
Assets/Fungus/Dialog/Audio.meta

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

0
Assets/Examples/TheHunter/Audio/Typing/SkeletalType.wav → Assets/Fungus/Dialog/Audio/SkeletalType.wav

0
Assets/Examples/TheHunter/Audio/Typing/SkeletalType.wav.meta → Assets/Fungus/Dialog/Audio/SkeletalType.wav.meta

59
Assets/Fungus/Dialog/Prefabs/ChooseDialog.prefab

@ -356,6 +356,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Resolution: {x: 1024, y: 768} m_Resolution: {x: 1024, y: 768}
m_CanvasScaleMode: 0
m_MatchWidthOrHeight: 0 m_MatchWidthOrHeight: 0
--- !u!114 &11400004 --- !u!114 &11400004
MonoBehaviour: MonoBehaviour:
@ -409,8 +410,8 @@ MonoBehaviour:
m_HighlightedTrigger: Highlighted m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed m_PressedTrigger: Pressed
m_DisabledTrigger: Disabled m_DisabledTrigger: Disabled
m_TargetGraphic: {fileID: 11400008}
m_Interactable: 1 m_Interactable: 1
m_TargetGraphic: {fileID: 11400008}
m_OnClick: m_OnClick:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
@ -427,7 +428,7 @@ MonoBehaviour:
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Mat: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: .588} m_Color: {r: 1, g: 1, b: 1, a: .588}
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1 m_Type: 1
@ -448,7 +449,7 @@ MonoBehaviour:
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Mat: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Sprite: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9, type: 3} m_Sprite: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9, type: 3}
m_Type: 0 m_Type: 0
@ -469,7 +470,7 @@ MonoBehaviour:
m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Mat: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FontData: m_FontData:
m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3} m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3}
@ -509,7 +510,7 @@ MonoBehaviour:
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Mat: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: .39199999} m_Color: {r: 1, g: 1, b: 1, a: .39199999}
m_Sprite: {fileID: 10909, guid: 0000000000000000f000000000000000, type: 0} m_Sprite: {fileID: 10909, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1 m_Type: 1
@ -530,7 +531,7 @@ MonoBehaviour:
m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Mat: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 1} m_Color: {r: 0, g: 0, b: 0, a: 1}
m_FontData: m_FontData:
m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3} m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3}
@ -570,7 +571,7 @@ MonoBehaviour:
m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Mat: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FontData: m_FontData:
m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3} m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3}
@ -606,6 +607,8 @@ MonoBehaviour:
m_StartAxis: 0 m_StartAxis: 0
m_CellSize: {x: 300, y: 30} m_CellSize: {x: 300, y: 30}
m_Spacing: {x: 0, y: 0} m_Spacing: {x: 0, y: 0}
m_Constraint: 0
m_ConstraintCount: 2
--- !u!114 &11400026 --- !u!114 &11400026
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@ -640,8 +643,8 @@ MonoBehaviour:
m_HighlightedTrigger: Highlighted m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed m_PressedTrigger: Pressed
m_DisabledTrigger: Disabled m_DisabledTrigger: Disabled
m_TargetGraphic: {fileID: 11400028}
m_Interactable: 1 m_Interactable: 1
m_TargetGraphic: {fileID: 11400028}
m_OnClick: m_OnClick:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
@ -658,7 +661,7 @@ MonoBehaviour:
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Mat: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: .588} m_Color: {r: 1, g: 1, b: 1, a: .588}
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1 m_Type: 1
@ -720,8 +723,8 @@ MonoBehaviour:
m_HighlightedTrigger: Highlighted m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed m_PressedTrigger: Pressed
m_DisabledTrigger: Disabled m_DisabledTrigger: Disabled
m_TargetGraphic: {fileID: 11400034}
m_Interactable: 1 m_Interactable: 1
m_TargetGraphic: {fileID: 11400034}
m_FillRect: {fileID: 22400032} m_FillRect: {fileID: 22400032}
m_HandleRect: {fileID: 0} m_HandleRect: {fileID: 0}
m_Direction: 0 m_Direction: 0
@ -745,7 +748,7 @@ MonoBehaviour:
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Mat: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: .588} m_Color: {r: 1, g: 1, b: 1, a: .588}
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1 m_Type: 1
@ -766,7 +769,7 @@ MonoBehaviour:
m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Mat: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 1} m_Color: {r: 0, g: 0, b: 0, a: 1}
m_FontData: m_FontData:
m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3} m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3}
@ -793,9 +796,10 @@ 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
clickAnywhere: 1
dialogCanvas: {fileID: 22300000} dialogCanvas: {fileID: 22300000}
nameText: {fileID: 11400022} nameText: {fileID: 11400022}
storyText: {fileID: 11400012} storyText: {fileID: 11400012}
@ -840,8 +844,8 @@ MonoBehaviour:
m_HighlightedTrigger: Highlighted m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed m_PressedTrigger: Pressed
m_DisabledTrigger: Disabled m_DisabledTrigger: Disabled
m_TargetGraphic: {fileID: 11400044}
m_Interactable: 1 m_Interactable: 1
m_TargetGraphic: {fileID: 11400044}
m_OnClick: m_OnClick:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
@ -858,7 +862,7 @@ MonoBehaviour:
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Mat: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: .588} m_Color: {r: 1, g: 1, b: 1, a: .588}
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1 m_Type: 1
@ -897,7 +901,7 @@ MonoBehaviour:
m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Mat: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 1} m_Color: {r: 0, g: 0, b: 0, a: 1}
m_FontData: m_FontData:
m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3} m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3}
@ -964,8 +968,8 @@ MonoBehaviour:
m_HighlightedTrigger: Highlighted m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed m_PressedTrigger: Pressed
m_DisabledTrigger: Disabled m_DisabledTrigger: Disabled
m_TargetGraphic: {fileID: 11400054}
m_Interactable: 1 m_Interactable: 1
m_TargetGraphic: {fileID: 11400054}
m_OnClick: m_OnClick:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
@ -982,7 +986,7 @@ MonoBehaviour:
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Mat: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: .588} m_Color: {r: 1, g: 1, b: 1, a: .588}
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1 m_Type: 1
@ -1003,7 +1007,7 @@ MonoBehaviour:
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Mat: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 0, g: 1, b: .0896551609, a: .588235319} m_Color: {r: 0, g: 1, b: .0896551609, a: .588235319}
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1 m_Type: 1
@ -1024,7 +1028,7 @@ MonoBehaviour:
m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Mat: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 1} m_Color: {r: 0, g: 0, b: 0, a: 1}
m_FontData: m_FontData:
m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3} m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3}
@ -1045,84 +1049,98 @@ CanvasRenderer:
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100002} m_GameObject: {fileID: 100002}
m_HideIfInvisible: 0
--- !u!222 &22200002 --- !u!222 &22200002
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100004} m_GameObject: {fileID: 100004}
m_HideIfInvisible: 0
--- !u!222 &22200004 --- !u!222 &22200004
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100006} m_GameObject: {fileID: 100006}
m_HideIfInvisible: 0
--- !u!222 &22200006 --- !u!222 &22200006
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100008} m_GameObject: {fileID: 100008}
m_HideIfInvisible: 0
--- !u!222 &22200008 --- !u!222 &22200008
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100010} m_GameObject: {fileID: 100010}
m_HideIfInvisible: 0
--- !u!222 &22200010 --- !u!222 &22200010
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100012} m_GameObject: {fileID: 100012}
m_HideIfInvisible: 0
--- !u!222 &22200012 --- !u!222 &22200012
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100016} m_GameObject: {fileID: 100016}
m_HideIfInvisible: 0
--- !u!222 &22200014 --- !u!222 &22200014
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100018} m_GameObject: {fileID: 100018}
m_HideIfInvisible: 0
--- !u!222 &22200016 --- !u!222 &22200016
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100020} m_GameObject: {fileID: 100020}
m_HideIfInvisible: 0
--- !u!222 &22200018 --- !u!222 &22200018
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100028} m_GameObject: {fileID: 100028}
m_HideIfInvisible: 0
--- !u!222 &22200020 --- !u!222 &22200020
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100030} m_GameObject: {fileID: 100030}
m_HideIfInvisible: 0
--- !u!222 &22200022 --- !u!222 &22200022
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100032} m_GameObject: {fileID: 100032}
m_HideIfInvisible: 0
--- !u!222 &22200024 --- !u!222 &22200024
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100034} m_GameObject: {fileID: 100034}
m_HideIfInvisible: 0
--- !u!222 &22200026 --- !u!222 &22200026
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100036} m_GameObject: {fileID: 100036}
m_HideIfInvisible: 0
--- !u!223 &22300000 --- !u!223 &22300000
Canvas: Canvas:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@ -1136,6 +1154,7 @@ Canvas:
m_PlaneDistance: 100 m_PlaneDistance: 100
m_PixelPerfect: 0 m_PixelPerfect: 0
m_ReceivesEvents: 1 m_ReceivesEvents: 1
m_OverrideSorting: 0
m_SortingLayerID: 0 m_SortingLayerID: 0
m_SortingOrder: 0 m_SortingOrder: 0
--- !u!224 &22400000 --- !u!224 &22400000

56
Assets/Fungus/Dialog/Prefabs/NarratorDialog.prefab

@ -44,6 +44,8 @@ GameObject:
- 224: {fileID: 22400002} - 224: {fileID: 22400002}
- 222: {fileID: 22200000} - 222: {fileID: 22200000}
- 114: {fileID: 11400006} - 114: {fileID: 11400006}
- 225: {fileID: 22500000}
- 114: {fileID: 11400014}
m_Layer: 5 m_Layer: 5
m_Name: Panel m_Name: Panel
m_TagString: Untagged m_TagString: Untagged
@ -111,6 +113,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Resolution: {x: 1024, y: 768} m_Resolution: {x: 1024, y: 768}
m_CanvasScaleMode: 0
m_MatchWidthOrHeight: 0 m_MatchWidthOrHeight: 0
--- !u!114 &11400002 --- !u!114 &11400002
MonoBehaviour: MonoBehaviour:
@ -141,9 +144,10 @@ 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
clickAnywhere: 1
dialogCanvas: {fileID: 22300000} dialogCanvas: {fileID: 22300000}
nameText: {fileID: 0} nameText: {fileID: 0}
storyText: {fileID: 11400008} storyText: {fileID: 11400008}
@ -160,7 +164,7 @@ MonoBehaviour:
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Mat: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: .39199999} m_Color: {r: 1, g: 1, b: 1, a: .39199999}
m_Sprite: {fileID: 10909, guid: 0000000000000000f000000000000000, type: 0} m_Sprite: {fileID: 10909, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1 m_Type: 1
@ -181,7 +185,7 @@ MonoBehaviour:
m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Mat: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FontData: m_FontData:
m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3} m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3}
@ -221,7 +225,7 @@ MonoBehaviour:
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Mat: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Sprite: {fileID: 21300000, guid: b3426f0a4460547a69fc64b85700a13d, type: 3} m_Sprite: {fileID: 21300000, guid: b3426f0a4460547a69fc64b85700a13d, type: 3}
m_Type: 0 m_Type: 0
@ -231,24 +235,57 @@ MonoBehaviour:
m_FillAmount: 1 m_FillAmount: 1
m_FillClockwise: 1 m_FillClockwise: 1
m_FillOrigin: 0 m_FillOrigin: 0
--- !u!114 &11400014
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100004}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -1862395651, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
delegates:
- eventID: 4
callback:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 11400004}
m_MethodName: OnPointerClick
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 1
m_TypeName: UnityEngine.EventSystems.EventTrigger+TriggerEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
--- !u!222 &22200000 --- !u!222 &22200000
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100004} m_GameObject: {fileID: 100004}
m_HideIfInvisible: 0
--- !u!222 &22200002 --- !u!222 &22200002
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100006} m_GameObject: {fileID: 100006}
m_HideIfInvisible: 0
--- !u!222 &22200004 --- !u!222 &22200004
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100008} m_GameObject: {fileID: 100008}
m_HideIfInvisible: 0
--- !u!223 &22300000 --- !u!223 &22300000
Canvas: Canvas:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@ -262,6 +299,7 @@ Canvas:
m_PlaneDistance: 100 m_PlaneDistance: 100
m_PixelPerfect: 0 m_PixelPerfect: 0
m_ReceivesEvents: 1 m_ReceivesEvents: 1
m_OverrideSorting: 0
m_SortingLayerID: 0 m_SortingLayerID: 0
m_SortingOrder: 0 m_SortingOrder: 0
--- !u!224 &22400000 --- !u!224 &22400000
@ -335,6 +373,16 @@ RectTransform:
m_AnchoredPosition: {x: -2.43186951e-05, y: 15.8000002} m_AnchoredPosition: {x: -2.43186951e-05, y: 15.8000002}
m_SizeDelta: {x: -.300000191, y: 32.0999985} m_SizeDelta: {x: -.300000191, y: 32.0999985}
m_Pivot: {x: .5, y: .5} m_Pivot: {x: .5, y: .5}
--- !u!225 &22500000
CanvasGroup:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100004}
m_Alpha: 1
m_Interactable: 1
m_BlocksRaycasts: 1
m_IgnoreParentGroups: 0
--- !u!1001 &100100000 --- !u!1001 &100100000
Prefab: Prefab:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1

64
Assets/Fungus/Dialog/Prefabs/SayDialog.prefab

@ -61,6 +61,8 @@ GameObject:
- 224: {fileID: 22400004} - 224: {fileID: 22400004}
- 222: {fileID: 22200002} - 222: {fileID: 22200002}
- 114: {fileID: 11400008} - 114: {fileID: 11400008}
- 225: {fileID: 22500000}
- 114: {fileID: 11400020}
m_Layer: 5 m_Layer: 5
m_Name: Panel m_Name: Panel
m_TagString: Untagged m_TagString: Untagged
@ -145,7 +147,7 @@ MonoBehaviour:
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Mat: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Sprite: {fileID: 21300000, guid: b3426f0a4460547a69fc64b85700a13d, type: 3} m_Sprite: {fileID: 21300000, guid: b3426f0a4460547a69fc64b85700a13d, type: 3}
m_Type: 0 m_Type: 0
@ -184,6 +186,7 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Resolution: {x: 1024, y: 768} m_Resolution: {x: 1024, y: 768}
m_CanvasScaleMode: 0
m_MatchWidthOrHeight: 0 m_MatchWidthOrHeight: 0
--- !u!114 &11400006 --- !u!114 &11400006
MonoBehaviour: MonoBehaviour:
@ -197,9 +200,10 @@ 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
clickAnywhere: 1
dialogCanvas: {fileID: 22300000} dialogCanvas: {fileID: 22300000}
nameText: {fileID: 11400012} nameText: {fileID: 11400012}
storyText: {fileID: 11400014} storyText: {fileID: 11400014}
@ -216,7 +220,7 @@ MonoBehaviour:
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Mat: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: .39199999} m_Color: {r: 1, g: 1, b: 1, a: .39199999}
m_Sprite: {fileID: 10909, guid: 0000000000000000f000000000000000, type: 0} m_Sprite: {fileID: 10909, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1 m_Type: 1
@ -251,7 +255,7 @@ MonoBehaviour:
m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Mat: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FontData: m_FontData:
m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3} m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3}
@ -277,7 +281,7 @@ MonoBehaviour:
m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Mat: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FontData: m_FontData:
m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3} m_Font: {fileID: 12800000, guid: bb145366ce7024469a5758b08d31802c, type: 3}
@ -317,9 +321,9 @@ MonoBehaviour:
m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_Mat: {fileID: 0} m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1} m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Sprite: {fileID: 21300002, guid: 05ccd53483a554ca9b31f685fa76154a, type: 3} m_Sprite: {fileID: 21300000, guid: ea8f56c43254d41728f5ac4e8299b6c9, type: 3}
m_Type: 0 m_Type: 0
m_PreserveAspect: 1 m_PreserveAspect: 1
m_FillCenter: 1 m_FillCenter: 1
@ -327,36 +331,71 @@ MonoBehaviour:
m_FillAmount: 1 m_FillAmount: 1
m_FillClockwise: 1 m_FillClockwise: 1
m_FillOrigin: 0 m_FillOrigin: 0
--- !u!114 &11400020
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100006}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -1862395651, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3}
m_Name:
m_EditorClassIdentifier:
delegates:
- eventID: 4
callback:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 11400006}
m_MethodName: OnPointerClick
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 1
m_TypeName: UnityEngine.EventSystems.EventTrigger+TriggerEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
--- !u!222 &22200000 --- !u!222 &22200000
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100000} m_GameObject: {fileID: 100000}
m_HideIfInvisible: 0
--- !u!222 &22200002 --- !u!222 &22200002
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100006} m_GameObject: {fileID: 100006}
m_HideIfInvisible: 0
--- !u!222 &22200004 --- !u!222 &22200004
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100008} m_GameObject: {fileID: 100008}
m_HideIfInvisible: 0
--- !u!222 &22200006 --- !u!222 &22200006
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100010} m_GameObject: {fileID: 100010}
m_HideIfInvisible: 0
--- !u!222 &22200008 --- !u!222 &22200008
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0} m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000} m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100012} m_GameObject: {fileID: 100012}
m_HideIfInvisible: 0
--- !u!223 &22300000 --- !u!223 &22300000
Canvas: Canvas:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@ -370,6 +409,7 @@ Canvas:
m_PlaneDistance: 100 m_PlaneDistance: 100
m_PixelPerfect: 0 m_PixelPerfect: 0
m_ReceivesEvents: 1 m_ReceivesEvents: 1
m_OverrideSorting: 0
m_SortingLayerID: 0 m_SortingLayerID: 0
m_SortingOrder: 0 m_SortingOrder: 0
--- !u!224 &22400000 --- !u!224 &22400000
@ -479,6 +519,16 @@ RectTransform:
m_AnchoredPosition: {x: 79, y: .0699939728} m_AnchoredPosition: {x: 79, y: .0699939728}
m_SizeDelta: {x: 216, y: 216} m_SizeDelta: {x: 216, y: 216}
m_Pivot: {x: .5, y: 0} m_Pivot: {x: .5, y: 0}
--- !u!225 &22500000
CanvasGroup:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 100006}
m_Alpha: 1
m_Interactable: 1
m_BlocksRaycasts: 1
m_IgnoreParentGroups: 0
--- !u!1001 &100100000 --- !u!1001 &100100000
Prefab: Prefab:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1

28
Assets/Fungus/Dialog/Scripts/Dialog.cs

@ -16,6 +16,9 @@ namespace Fungus
public bool loopWritingSound = true; public bool loopWritingSound = true;
public float punctuationPause = 0.25f; public float punctuationPause = 0.25f;
[Tooltip("Click anywhere on screen to continue when set to true, or only on dialog when false.")]
public bool clickAnywhere = true;
public Canvas dialogCanvas; public Canvas dialogCanvas;
public Text nameText; public Text nameText;
public Text storyText; public Text storyText;
@ -28,6 +31,8 @@ namespace Fungus
protected bool colorActive; protected bool colorActive;
protected string colorText; protected string colorText;
protected bool wasPointerClicked;
protected enum GlyphType protected enum GlyphType
{ {
Character, // Text character Character, // Text character
@ -52,6 +57,17 @@ namespace Fungus
public string param = ""; public string param = "";
} }
protected virtual void LateUpdate()
{
wasPointerClicked = false;
if (clickAnywhere &&
Input.GetMouseButtonDown(0))
{
wasPointerClicked = true;
}
}
public virtual void ShowDialog(bool visible) public virtual void ShowDialog(bool visible)
{ {
if (dialogCanvas != null) if (dialogCanvas != null)
@ -199,9 +215,10 @@ namespace Fungus
storyText.text += start + glyph.param + end; storyText.text += start + glyph.param + end;
if (Input.GetMouseButtonDown(0)) if (wasPointerClicked)
{ {
currentSpeed = 10000; // Write instantly currentSpeed = 10000; // Write instantly
wasPointerClicked = false;
} }
} }
@ -533,11 +550,13 @@ namespace Fungus
protected virtual IEnumerator WaitForInput(Action onInput) protected virtual IEnumerator WaitForInput(Action onInput)
{ {
while (!Input.GetMouseButtonDown(0)) while (!wasPointerClicked)
{ {
yield return null; yield return null;
} }
wasPointerClicked = false;
if (onInput != null) if (onInput != null)
{ {
onInput(); onInput();
@ -546,6 +565,11 @@ namespace Fungus
protected virtual void OnWaitForInputTag(bool waiting) protected virtual void OnWaitForInputTag(bool waiting)
{} {}
public virtual void OnPointerClick()
{
wasPointerClicked = true;
}
} }
} }

Loading…
Cancel
Save