Browse Source

Continue image is now a button

Added a button-only option in Dialog Input
master
chrisgregan 9 years ago
parent
commit
23c561bca8
  1. 22
      Assets/Fungus/Narrative/Resources/SayDialog.prefab
  2. 16
      Assets/Fungus/Narrative/Scripts/DialogInput.cs
  3. 8
      Assets/Fungus/Narrative/Scripts/SayDialog.cs
  4. 1458
      Assets/FungusExamples/Sherlock/TheExperiment.unity

22
Assets/Fungus/Narrative/Resources/SayDialog.prefab

@ -82,6 +82,7 @@ GameObject:
- 224: {fileID: 22488900} - 224: {fileID: 22488900}
- 222: {fileID: 22288900} - 222: {fileID: 22288900}
- 114: {fileID: 11488904} - 114: {fileID: 11488904}
- 225: {fileID: 22583964}
- 114: {fileID: 11478524} - 114: {fileID: 11478524}
m_Layer: 5 m_Layer: 5
m_Name: Panel m_Name: Panel
@ -297,9 +298,10 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 43b85556abd314f3f870c18c013fdcef, type: 3} m_Script: {fileID: 11500000, guid: 43b85556abd314f3f870c18c013fdcef, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
clickMode: 2 clickMode: 1
keyPressMode: 2 keyPressMode: 2
nextClickDelay: .200000003 shiftKeyEnabled: 1
nextClickDelay: 0
keyList: 0900000020000000 keyList: 0900000020000000
--- !u!114 &11486804 --- !u!114 &11486804
MonoBehaviour: MonoBehaviour:
@ -344,15 +346,12 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 3a0bbe22c246e4c78ad8e9816cbae9d5, type: 3} m_Script: {fileID: 11500000, guid: 3a0bbe22c246e4c78ad8e9816cbae9d5, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
alwaysFadeDialog: 0
fadeDuration: .25 fadeDuration: .25
fadeEaseType: 0 continueButton: {fileID: 0}
dialogCanvas: {fileID: 22388894} dialogCanvas: {fileID: 22388894}
nameText: {fileID: 11488900} nameText: {fileID: 11488900}
storyText: {fileID: 11488896} storyText: {fileID: 11488896}
characterImage: {fileID: 11448914} characterImage: {fileID: 11448914}
continueImage: {fileID: 11488898}
continueSound: {fileID: 0}
--- !u!114 &11488896 --- !u!114 &11488896
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1
@ -648,6 +647,17 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0} m_Pivot: {x: 0, y: 0}
--- !u!225 &22583964
CanvasGroup:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 188900}
m_Enabled: 1
m_Alpha: 1
m_Interactable: 1
m_BlocksRaycasts: 1
m_IgnoreParentGroups: 0
--- !u!225 &22588896 --- !u!225 &22588896
CanvasGroup: CanvasGroup:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1

16
Assets/Fungus/Narrative/Scripts/DialogInput.cs

@ -13,9 +13,10 @@ namespace Fungus
{ {
public enum ClickMode public enum ClickMode
{ {
Disabled, // Clicking disabled Disabled, // Clicking disabled
ClickAnywhere, // Click anywhere on screen to advance ClickAnywhere, // Click anywhere on screen to advance
ClickOnDialog // Click anywhere on Say Dialog to advance ClickOnDialog, // Click anywhere on Say Dialog to advance
ClickOnButton // Click on continue button to advance
} }
public enum KeyPressMode public enum KeyPressMode
@ -73,6 +74,15 @@ namespace Fungus
} }
} }
public void SetButtonClickedFlag()
{
// Only applies if clicking is not disabled
if (clickMode != ClickMode.Disabled)
{
SetNextLineFlag();
}
}
protected virtual void Update() protected virtual void Update()
{ {
switch (keyPressMode) switch (keyPressMode)

8
Assets/Fungus/Narrative/Scripts/SayDialog.cs

@ -12,12 +12,12 @@ namespace Fungus
// Currently active Say Dialog used to display Say text // Currently active Say Dialog used to display Say text
public static SayDialog activeSayDialog; public static SayDialog activeSayDialog;
// Most recent speaking character
public static Character speakingCharacter; public static Character speakingCharacter;
public Image continueImage;
public AudioClip continueSound;
public float fadeDuration = 0.25f; public float fadeDuration = 0.25f;
public Button continueButton;
public Canvas dialogCanvas; public Canvas dialogCanvas;
public Text nameText; public Text nameText;
public Text storyText; public Text storyText;
@ -108,9 +108,9 @@ namespace Fungus
{ {
UpdateAlpha(); UpdateAlpha();
if (continueImage != null) if (continueButton != null)
{ {
continueImage.enabled = GetWriter().isWaitingForInput; continueButton.enabled = GetWriter().isWaitingForInput;
} }
} }

1458
Assets/FungusExamples/Sherlock/TheExperiment.unity

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save