Skip to content

aleksandrpp/JEcs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JEcs - ECS architecture for game objects

In Unity, we have a default component such as Transform, Renderer, Collider, etc. So why not create an ECS based on the built-in Unity Components by simply adding systems to game objects, allowing for writing scalable modular code.

JEcs


Baking

The library uses prototypes to create Entity, and all Unity Component objects are "baked" for quick access and filtering.


Systems

Systems are written separately, and their updates are performed based on the set priority in the necessary callback - Update, FixedUpdate, LateUpdate.

[ExecutionGroup(SystemGroup.Update), ExecutionOrder(100)]
public class MovementSystem : ISystem
{
    public void Update(HashSet<Entity> entities)
    {
        entities.Foreach<Transform, Velocity>((entity, transform, velocity) =>
        {
            transform.position += velocity.Value * Time.deltaTime;
        });
    }
}

World

Systems, like components, can be added and removed in real-time, and their sorting occurs during addition.

_entityWorld = new EntityWorld();
_entityWorld.AddSystem(new MovementSystem());
_entityWorld.RemoveSystem<MovementSystem>();

v0.0.3

https://github.com/aleksandrpp/JEcs

About

Simple ECS architecture for Unity game objects

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages