Browse Source

Added timeout slider to choose dialog

master
chrisgregan 10 years ago
parent
commit
470050417e
  1. 17
      Assets/Fungus/Dialog/Scripts/ChooseDialog.cs
  2. BIN
      Assets/Shuttle/ShuttleGame.unity

17
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,7 +40,20 @@ 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();

BIN
Assets/Shuttle/ShuttleGame.unity

Binary file not shown.
Loading…
Cancel
Save