Browse Source

Added RunScript command

master
chrisgregan 10 years ago
parent
commit
ab97f699c3
  1. 48
      Assets/Fungus/FungusScript/Commands/RunScript.cs
  2. 8
      Assets/Fungus/FungusScript/Commands/RunScript.cs.meta

48
Assets/Fungus/FungusScript/Commands/RunScript.cs

@ -0,0 +1,48 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace Fungus
{
[CommandInfo("Scripting",
"Run Script",
"Start executing another Fungus Script.")]
public class RunScript : Command
{
public FungusScript targetFungusScript;
public bool stopCurrentScript = true;
public override void OnEnter()
{
if (targetFungusScript != null)
{
if (stopCurrentScript)
{
Stop();
}
targetFungusScript.Execute();
}
else
{
Continue();
}
}
public override string GetSummary()
{
if (targetFungusScript == null)
{
return "<Continue>";
}
return targetFungusScript.name;
}
public override Color GetButtonColor()
{
return new Color32(235, 191, 217, 255);
}
}
}

8
Assets/Fungus/FungusScript/Commands/RunScript.cs.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bd63e1ab17e844866b85f8574fa073ee
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
Loading…
Cancel
Save