using System;
using XGame.Framework.Components;
namespace XGame.Framework.Nodes
{
///
/// node的逻辑组件基类
///
public abstract class NodeComponent : INodeComponent, IDisposable
{
private NodeContext _context;
public NodeContext Context => _context;
///
/// node节点的忽略order
///
public int Order => 0;
void IComponent.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()
{
}
}
}