using System;
namespace XGame.Framework.Nodes
{
///
/// node的逻辑组件基类
///
public abstract class NodeComponent : INodeComponent, IDisposable
{
private NodeContext _context;
public NodeContext Context => _context;
///
/// node节点的忽略order
///
public int Order => 0;
public void Bind(object context)
{
_context = context as NodeContext;
}
void IDisposable.Dispose()
{
OnDispose();
_context = default;
}
public abstract void OnEnable(object intent);
public abstract void OnDisable();
protected virtual void OnDispose()
{
}
}
}