You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How would I got about dynamically adding new systems and components to the main loop without needing to modify it?
Take this for example...
publicstaticvoidMain(string[]args){vardeltaTime=0.05f;// This is mostly given by engines, frameworks// Create a world and a group of systems which will be controlled varworld=World.Create();var_systems=newGroup<float>(newMovementSystem(world),// Run in ordernewMyOtherSystem(...),
...);_systems.Initialize();// Inits all registered systems_systems.BeforeUpdate(indeltaTime);// Calls .BeforeUpdate on all systems ( can be overriden )_systems.Update(indeltaTime);// Calls .Update on all systems ( can be overriden )_systems.AfterUpdate(indeltaTime);// Calls .AfterUpdate on all System ( can be overriden )_systems.Dispose();// Calls .Dispose on all systems ( can be overriden )}
publicstaticvoidMain(string[]args){varworld=World.Create();world.Run();}publicstaticpartialclassSystems{//SystemAttribute automatically adds it to the main world.[System][Query][MethodImpl(MethodImplOptions.AggressiveInlining)]publicstaticvoidMoveEntities([Data]infloattime,refPositionposition,refVelocityvelocity){position.X+=velocity.X*time;position.Y+=velocity.Y*time;position.Z+=velocity.Z*time;}}
The text was updated successfully, but these errors were encountered:
Shadowblitz16
changed the title
Adding systems and components through plugin system?
Adding systems and components dynamicly?
Oct 11, 2024
Thats possible, but not build in yet. Could come in the future tho, for now you need to manage that yourself... or you write such a generator yourself ^^
How would I got about dynamically adding new systems and components to the main loop without needing to modify it?
Take this for example...
Is there a way I can do something like this?
or maybe something like this...
The text was updated successfully, but these errors were encountered: