添加了授权
This commit is contained in:
@@ -51,6 +51,7 @@ public partial class Entity : Node,IEntity
|
||||
public override void _ExitTree()
|
||||
{
|
||||
_cancellationTokenSource.Cancel();
|
||||
_entitiesService.UnRegister(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -95,6 +96,8 @@ public partial class Entity : Node,IEntity
|
||||
this._components = entityComponents.ToArray();
|
||||
SetMeta("Components",Variant.From(_components.Select(x=>x.GetType().Name).ToArray()));
|
||||
}
|
||||
|
||||
|
||||
public bool TryGetComponent<T>(out T component)
|
||||
{
|
||||
if (TypeComponents.TryGetValue(typeof(T), out var iComponent) && iComponent is T _component)
|
||||
@@ -105,14 +108,6 @@ public partial class Entity : Node,IEntity
|
||||
component = default;
|
||||
return false;
|
||||
}
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
if (disposing)
|
||||
{
|
||||
_entitiesService.UnRegister(this);
|
||||
}
|
||||
}
|
||||
|
||||
public bool RegisterComponent<T>(T component)
|
||||
{
|
||||
|
Reference in New Issue
Block a user