From 470050417e240edadca615c01c7c1f752917bd10 Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Thu, 28 Aug 2014 15:48:20 +0100 Subject: [PATCH] Added timeout slider to choose dialog --- Assets/Fungus/Dialog/Scripts/ChooseDialog.cs | 19 +++++++++++++++++-- Assets/Shuttle/ShuttleGame.unity | Bin 110476 -> 116532 bytes 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Assets/Fungus/Dialog/Scripts/ChooseDialog.cs b/Assets/Fungus/Dialog/Scripts/ChooseDialog.cs index d5474857..c1c45b89 100644 --- a/Assets/Fungus/Dialog/Scripts/ChooseDialog.cs +++ b/Assets/Fungus/Dialog/Scripts/ChooseDialog.cs @@ -9,6 +9,8 @@ namespace Fungus.Script public class ChooseDialog : Dialog { + public Slider slider; + public class Option { public string text; @@ -38,8 +40,21 @@ namespace Fungus.Script IEnumerator WaitForTimeout(float timeoutDuration, Action onTimeout) { - yield return new WaitForSeconds(timeoutDuration); - + float elapsedTime = 0; + + while (elapsedTime < timeoutDuration) + { + if (slider != null) + { + float t = elapsedTime / timeoutDuration; + slider.value = t; + } + + elapsedTime += Time.deltaTime; + + yield return null; + } + Clear(); if (onTimeout != null) diff --git a/Assets/Shuttle/ShuttleGame.unity b/Assets/Shuttle/ShuttleGame.unity index be6755e7116173d1d3c5a73d42531ae3712ea3b2..74c45dc6fe4a81a04059c7a5801a7211a01719ba 100644 GIT binary patch delta 5780 zcmZXY4^&iD9>?#6QHNG-3^FLhQL#|S02RmN&nVaqitgH=JUS4 z-~HX+{oVWSnZ}DFPwgM2BlOYx2t7B85E6#_#CF}4_>ON|-VGJ%LPvG@X739Td`a;% zvOWKu(2iG6esY(fOB*?{z_zw#x!da8xUR}wnNBK89;*x`U-h zD0n@BdL?gLUyr7BlEqHRVwcqClft<8DB-@YaJpNF?|O*t5temLqkAP?y`*c9bWh>58I{2(HCbMkFHL zRJgt@T=-;K7)?S9gYm&!21}f+*1a$`Kd}MK%5`!OYyhkgEFiZgu(}jN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