using System.Collections.Generic;
using Bolt;
namespace Game
{
///
/// Node基类 项目内所有节点继承自该类
/// 有一个ControlInput的默认节点
///
public class NodeBase : Unit
{
public ControlInput input { get; protected set; }
protected BlueprintBasicData data;
protected List tempListInt = new List();
protected override void Definition()
{
input = ControlInput("", Enter);
OnDefinition();
}
private ControlOutput Enter(Flow flow)
{
data = Variables.Object(flow.stack.gameObject).Get("data");
return OnEnter(flow);
}
protected virtual void OnDefinition() { }
protected virtual ControlOutput OnEnter(Flow flow) { return null; }
}
///
/// 有一个ControlInput和一个ControlOutput的默认节点
///
public class NodeDefault : NodeBase
{
public ControlOutput output { get; protected set; }
protected override void OnDefinition()
{
output = ControlOutput("");
Def();
}
protected override ControlOutput OnEnter(Flow flow)
{
Run(flow);
return output;
}
protected virtual void Def() { }
protected virtual void Run(Flow flow) { }
}
}