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.
51 lines
912 B
51 lines
912 B
10 years ago
|
using UnityEngine;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
|
||
10 years ago
|
namespace Fungus
|
||
10 years ago
|
{
|
||
10 years ago
|
[CommandInfo("Scripting",
|
||
|
"Call",
|
||
10 years ago
|
"Execute another sequence in the same Fungus Script.")]
|
||
10 years ago
|
public class Call : Command
|
||
10 years ago
|
{
|
||
10 years ago
|
[Tooltip("Sequence to execute")]
|
||
10 years ago
|
public Sequence targetSequence;
|
||
|
|
||
|
public override void OnEnter()
|
||
|
{
|
||
|
if (targetSequence != null)
|
||
|
{
|
||
|
ExecuteSequence(targetSequence);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
Continue();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public override void GetConnectedSequences(ref List<Sequence> connectedSequences)
|
||
|
{
|
||
|
if (targetSequence != null)
|
||
|
{
|
||
|
connectedSequences.Add(targetSequence);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public override string GetSummary()
|
||
|
{
|
||
|
if (targetSequence == null)
|
||
|
{
|
||
10 years ago
|
return "<Continue>";
|
||
10 years ago
|
}
|
||
|
|
||
10 years ago
|
return targetSequence.sequenceName;
|
||
10 years ago
|
}
|
||
10 years ago
|
|
||
|
public override Color GetButtonColor()
|
||
|
{
|
||
|
return new Color32(235, 191, 217, 255);
|
||
|
}
|
||
10 years ago
|
}
|
||
|
|
||
|
}
|