Browse Source

Replaced OnExecute() with OnEnter()

master
chrisgregan 11 years ago
parent
commit
f27648f060
  1. BIN
      Assets/Fungus/Tests/Sequence/SequenceTest.unity
  2. 2
      Assets/Fungus/VisualScripting/ExecuteCommand.cs
  3. 6
      Assets/Fungus/VisualScripting/FungusCommand.cs
  4. 2
      Assets/Fungus/VisualScripting/IfBooleanCommand.cs
  5. 4
      Assets/Fungus/VisualScripting/SayCommand.cs
  6. 4
      Assets/Fungus/VisualScripting/SetBooleanCommand.cs
  7. 4
      Assets/Fungus/VisualScripting/WaitCommand.cs

BIN
Assets/Fungus/Tests/Sequence/SequenceTest.unity

Binary file not shown.

2
Assets/Fungus/VisualScripting/ExecuteCommand.cs

@ -10,7 +10,7 @@ namespace Fungus
{ {
public Sequence targetSequence; public Sequence targetSequence;
public override void OnExecute() public override void OnEnter()
{ {
if (targetSequence == null) if (targetSequence == null)
{ {

6
Assets/Fungus/VisualScripting/FungusCommand.cs

@ -48,10 +48,9 @@ namespace Fungus
public virtual void Execute() public virtual void Execute()
{ {
OnEnter(); OnEnter();
OnExecute();
} }
public virtual void ExecuteNextCommand() public virtual void Finish()
{ {
OnExit(); OnExit();
parentSequence.ExecuteNextCommand(this); parentSequence.ExecuteNextCommand(this);
@ -70,9 +69,6 @@ namespace Fungus
public virtual void OnExit() public virtual void OnExit()
{} {}
public virtual void OnExecute()
{}
public virtual void GetConnectedSequences(ref List<Sequence> connectedSequences) public virtual void GetConnectedSequences(ref List<Sequence> connectedSequences)
{} {}
} }

2
Assets/Fungus/VisualScripting/IfBooleanCommand.cs

@ -13,7 +13,7 @@ namespace Fungus
public Sequence trueSequence; public Sequence trueSequence;
public Sequence falseSequence; public Sequence falseSequence;
public override void OnExecute() public override void OnEnter()
{ {
if (Variables.GetBoolean(key)) if (Variables.GetBoolean(key))
{ {

4
Assets/Fungus/VisualScripting/SayCommand.cs

@ -12,7 +12,7 @@ namespace Fungus
public List<Sequence> options = new List<Sequence>(); public List<Sequence> options = new List<Sequence>();
public override void OnExecute() public override void OnEnter()
{ {
Dialog dialog = Game.GetInstance().dialog; Dialog dialog = Game.GetInstance().dialog;
@ -26,7 +26,7 @@ namespace Fungus
} }
dialog.Say (text, delegate { dialog.Say (text, delegate {
ExecuteNextCommand(); Finish();
}); });
} }

4
Assets/Fungus/VisualScripting/SetBooleanCommand.cs

@ -12,10 +12,10 @@ namespace Fungus
public bool value; public bool value;
public override void OnExecute() public override void OnEnter()
{ {
Variables.SetBoolean(key, value); Variables.SetBoolean(key, value);
ExecuteNextCommand(); Finish();
} }
} }

4
Assets/Fungus/VisualScripting/WaitCommand.cs

@ -10,14 +10,14 @@ namespace Fungus
{ {
public float duration; public float duration;
public override void OnExecute() public override void OnEnter()
{ {
Invoke ("OnWaitComplete", duration); Invoke ("OnWaitComplete", duration);
} }
void OnWaitComplete() void OnWaitComplete()
{ {
ExecuteNextCommand(); Finish();
} }
} }

Loading…
Cancel
Save