|
|
@ -13,25 +13,31 @@ namespace Fungus |
|
|
|
{ |
|
|
|
{ |
|
|
|
public enum ClickMode |
|
|
|
public enum ClickMode |
|
|
|
{ |
|
|
|
{ |
|
|
|
Disabled, |
|
|
|
Disabled, // Clicking disabled |
|
|
|
ClickAnywhere, |
|
|
|
ClickAnywhere, // Click anywhere on screen to advance |
|
|
|
ClickOnDialog |
|
|
|
ClickOnDialog // Click anywhere on Say Dialog to advance |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public enum KeyPressMode |
|
|
|
public enum KeyPressMode |
|
|
|
{ |
|
|
|
{ |
|
|
|
Disabled, |
|
|
|
Disabled, // Key pressing disabled |
|
|
|
AnyKey, |
|
|
|
AnyKey, // Press any key to continue |
|
|
|
KeyPressed |
|
|
|
KeyPressed // Press one of specified keys to advance |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Tooltip("Click to advance story")] |
|
|
|
public ClickMode clickMode; |
|
|
|
public ClickMode clickMode; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Tooltip("Press a key to advance story")] |
|
|
|
public KeyPressMode keyPressMode; |
|
|
|
public KeyPressMode keyPressMode; |
|
|
|
|
|
|
|
|
|
|
|
public float nextClickDelay = 0.2f; |
|
|
|
[Tooltip("Hold down shift while pressing a key to advance though story instantly")] |
|
|
|
|
|
|
|
public bool shiftKeyEnabled = true; |
|
|
|
|
|
|
|
|
|
|
|
[Tooltip("Keycode of the key to activate on")] |
|
|
|
[Tooltip("Delay between consecutive clicks. Useful to prevent accidentally clicking through story.")] |
|
|
|
|
|
|
|
public float nextClickDelay = 0f; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Tooltip("Keycodes to check for key presses")] |
|
|
|
public KeyCode[] keyList; |
|
|
|
public KeyCode[] keyList; |
|
|
|
|
|
|
|
|
|
|
|
protected bool dialogClickedFlag; |
|
|
|
protected bool dialogClickedFlag; |
|
|
@ -81,12 +87,23 @@ namespace Fungus |
|
|
|
break; |
|
|
|
break; |
|
|
|
case KeyPressMode.KeyPressed: |
|
|
|
case KeyPressMode.KeyPressed: |
|
|
|
foreach (KeyCode keyCode in keyList) |
|
|
|
foreach (KeyCode keyCode in keyList) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (shiftKeyEnabled && |
|
|
|
|
|
|
|
(Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift))) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (Input.GetKey(keyCode)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
SetNextLineFlag(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (Input.GetKeyDown(keyCode)) |
|
|
|
if (Input.GetKeyDown(keyCode)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
SetNextLineFlag(); |
|
|
|
SetNextLineFlag(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|