Improve ecs query performance;

This commit is contained in:
2025-10-12 19:49:05 +09:00
parent 682200cbf1
commit 6d1b510ac1
27 changed files with 1546 additions and 992 deletions

View File

@@ -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>