Browse Source

Fixes for Stop Flowchart command #288

master
chrisgregan 9 years ago
parent
commit
e44ae3df45
  1. 5
      Assets/Fungus/Camera/Scripts/Commands/FadeToView.cs
  2. 5
      Assets/Fungus/Camera/Scripts/Commands/MoveToView.cs
  3. 1
      Assets/Fungus/Flowchart/Scripts/Block.cs
  4. 4
      Assets/Fungus/Flowchart/Scripts/Command.cs
  5. 23
      Assets/Fungus/UI/Scripts/Commands/Write.cs
  6. 3
      Assets/Fungus/UI/Scripts/Writer.cs
  7. 1027
      Assets/Tests/Scripting/Scripting.unity

5
Assets/Fungus/Camera/Scripts/Commands/FadeToView.cs

@ -66,6 +66,11 @@ namespace Fungus
}
}
public override void OnStopExecuting()
{
CameraController.GetInstance().StopAllCoroutines();
}
public override string GetSummary()
{
if (targetView == null)

5
Assets/Fungus/Camera/Scripts/Commands/MoveToView.cs

@ -46,6 +46,11 @@ namespace Fungus
}
}
public override void OnStopExecuting()
{
CameraController.GetInstance().StopAllCoroutines();
}
public override string GetSummary()
{
if (targetView == null)

1
Assets/Fungus/Flowchart/Scripts/Block.cs

@ -240,6 +240,7 @@ namespace Fungus
// Tell the executing command to stop immediately
if (activeCommand != null)
{
activeCommand.isExecuting = false;
activeCommand.OnStopExecuting();
}

4
Assets/Fungus/Flowchart/Scripts/Command.cs

@ -82,9 +82,13 @@ namespace Fungus
}
public virtual void Continue()
{
// This is a noop if the Block has already been stopped
if (isExecuting)
{
Continue(commandIndex + 1);
}
}
public virtual void Continue(int nextCommandIndex)
{

23
Assets/Fungus/UI/Scripts/Commands/Write.cs

@ -42,6 +42,17 @@ namespace Fungus
public ColorData setColor = new ColorData(Color.white);
protected Writer GetWriter()
{
Writer writer = textObject.GetComponent<Writer>();
if (writer == null)
{
writer = textObject.AddComponent<Writer>() as Writer;
}
return writer;
}
public override void OnEnter()
{
if (textObject == null)
@ -50,7 +61,7 @@ namespace Fungus
return;
}
Writer writer = FindWriter(textObject);
Writer writer = GetWriter();
if (writer == null)
{
Continue();
@ -101,15 +112,9 @@ namespace Fungus
return new Color32(235, 191, 217, 255);
}
protected Writer FindWriter(GameObject textObject)
{
Writer writer = textObject.GetComponent<Writer>();
if (writer == null)
public override void OnStopExecuting()
{
writer = textObject.AddComponent<Writer>() as Writer;
}
return writer;
GetWriter().Stop();
}
//

3
Assets/Fungus/UI/Scripts/Writer.cs

@ -268,9 +268,12 @@ namespace Fungus
}
public virtual void Stop()
{
if (isWriting || isWaitingForInput)
{
exitFlag = true;
}
}
public virtual void Write(string content, bool clear, bool waitForInput, AudioClip audioClip, Action onComplete)
{

1027
Assets/Tests/Scripting/Scripting.unity

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