You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
731 B
41 lines
731 B
using UnityEngine; |
|
using System.Collections; |
|
using System.Collections.Generic; |
|
|
|
namespace Fungus |
|
{ |
|
[CommandInfo("Scripting", |
|
"Jump", |
|
"Move execution to a specific Label command")] |
|
[AddComponentMenu("")] |
|
public class Jump : Command |
|
{ |
|
public string labelName; |
|
|
|
public override void OnEnter() |
|
{ |
|
if (labelName.Length == 0) |
|
{ |
|
Continue(); |
|
return; |
|
} |
|
|
|
foreach (Command command in parentSequence.commandList) |
|
{ |
|
Label label = command as Label; |
|
if (label != null && |
|
label.labelName == labelName) |
|
{ |
|
Continue(label.commandIndex + 1); |
|
break; |
|
} |
|
} |
|
} |
|
|
|
public override Color GetButtonColor() |
|
{ |
|
return new Color32(253, 253, 150, 255); |
|
} |
|
} |
|
|
|
} |