1
This commit is contained in:
@@ -26,6 +26,18 @@ namespace BITKit.Entities
|
||||
}
|
||||
public CancellationToken CancellationToken { get; private set; }
|
||||
public IEntityBehavior[] Behaviors { get;private set; }
|
||||
public bool TryGetComponent(Type type, out IEntityComponent component)
|
||||
{
|
||||
var value = genericEvent.Get(type.FullName);
|
||||
if (value is not null)
|
||||
{
|
||||
component = (IEntityComponent)value;
|
||||
return true;
|
||||
}
|
||||
component = default!;
|
||||
return false;
|
||||
}
|
||||
|
||||
public IEntityComponent[] Components => Behaviors.Cast<IEntityComponent>().ToArray();
|
||||
private bool _initialized;
|
||||
bool Entities.IEntity.RegisterComponent<T>(T component)
|
||||
|
Reference in New Issue
Block a user