forked from Misaki/GhostEngine
Improve ecs query performance;
This commit is contained in:
@@ -2,7 +2,9 @@
|
||||
|
||||
public abstract class ScriptComponent : IComponentData
|
||||
{
|
||||
private bool _enable = true;
|
||||
private bool _enable;
|
||||
|
||||
internal World _world = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this script component is enabled.
|
||||
@@ -38,6 +40,11 @@ public abstract class ScriptComponent : IComponentData
|
||||
internal set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the EntityManager instance associated with the current world.
|
||||
/// </summary>
|
||||
protected EntityManager EntityManager => _world.EntityManager;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the priority of the script component.
|
||||
/// Change this during runtime does not affect the execution order.
|
||||
@@ -58,6 +65,13 @@ public abstract class ScriptComponent : IComponentData
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when the script component is initialized.
|
||||
/// </summary>
|
||||
public virtual void Initialize()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when the script component is started.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user