chrisgregan
10 years ago
2 changed files with 56 additions and 0 deletions
@ -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); |
||||
} |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue