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.
55 lines
961 B
55 lines
961 B
11 years ago
|
using UnityEngine;
|
||
10 years ago
|
using UnityEngine.Serialization;
|
||
11 years ago
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
|
||
11 years ago
|
namespace Fungus
|
||
11 years ago
|
{
|
||
10 years ago
|
|
||
11 years ago
|
[CommandInfo("Scripting",
|
||
|
"Call",
|
||
10 years ago
|
"Execute another block in the same Flowchart.")]
|
||
10 years ago
|
[AddComponentMenu("")]
|
||
11 years ago
|
public class Call : Command
|
||
11 years ago
|
{
|
||
10 years ago
|
[FormerlySerializedAs("targetSequence")]
|
||
|
[Tooltip("Block to execute")]
|
||
|
public Block targetBlock;
|
||
11 years ago
|
|
||
|
public override void OnEnter()
|
||
|
{
|
||
10 years ago
|
if (targetBlock != null)
|
||
11 years ago
|
{
|
||
10 years ago
|
ExecuteBlock(targetBlock);
|
||
11 years ago
|
}
|
||
|
else
|
||
|
{
|
||
|
Continue();
|
||
|
}
|
||
|
}
|
||
|
|
||
10 years ago
|
public override void GetConnectedBlocks(ref List<Block> connectedBlocks)
|
||
11 years ago
|
{
|
||
10 years ago
|
if (targetBlock != null)
|
||
11 years ago
|
{
|
||
10 years ago
|
connectedBlocks.Add(targetBlock);
|
||
11 years ago
|
}
|
||
|
}
|
||
|
|
||
|
public override string GetSummary()
|
||
|
{
|
||
10 years ago
|
if (targetBlock == null)
|
||
11 years ago
|
{
|
||
11 years ago
|
return "<Continue>";
|
||
11 years ago
|
}
|
||
|
|
||
10 years ago
|
return targetBlock.blockName;
|
||
11 years ago
|
}
|
||
11 years ago
|
|
||
|
public override Color GetButtonColor()
|
||
|
{
|
||
|
return new Color32(235, 191, 217, 255);
|
||
|
}
|
||
11 years ago
|
}
|
||
|
|
||
|
}
|