![]() |
Entitas
0.34.0
Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
|
Entitas provides an easy way to make upgrading to new versions a breeze. Either use the command line tool MigrationAssistant.exe
or the Migration menu item in Unity. After that generate again.
Example
GroupObserver
to EntityCollector
.CreateGroupObserver()
to .CreateEntityCollector()
IGroupObserverSystem
to IEntityCollectorSystem
public EntityCollector groupObserver
with public EntityCollector entityCollector
IDeinitializeSystem
to ITearDownSystem
Use the command line tool MigrationAssistant.exe
to automatically fix compile errors. Entitas 0.32.0 introduces a new Pools class. Using the new PoolsGenerator will require to update your existing project manually. You can still use the old Pools class in your existing project if you want. If so, please use the OldPoolsGenerator instead of the new one.
Some code generators got renamed. Apply Migration 0.30.0
Marked old PoolMetaData constructor obsolete. If you encounter compile errors please apply Migration 0.26.0, open C# project and generate again.
If you're using Entitas with Unity, please open the Entitas preferences and make sure that all your desired code generators are activated. Due to some code generator renamings the ComponentIndicesGenerators inactive.
The SystemsGenerator has been removed. Please use pool.CreateSystem<MySystem>()
instead.
If you're using Entitas with Unity, please open the Entitas preferences and make sure that all your desired code generators are activated. Due to some code generator renamings the ComponentLookupGenerator and the ComponentsGenerator are inactive. Activate them (if desired) and generate.
Use the command line tool MigrationAssistant.exe
to automatically fix compile errors. After that generate again.
To fix the compile errors after updating to Entitas 0.24.0, delete in Pools.cs
and generate again.
Entitas 0.23.0 changed and applied naming conventions. Before updating to this version, follow these steps to prepare your project:
Pool.Count -> Pool.count Group.Count -> Group.count Properties.count -> Properties.count
": AllOfMatcher " -> "" ": base(new [] { index }) " -> "" "static AllOfMatcher _matcher" -> "static IMatcher _matcher" "public static AllOfMatcher" -> "public static IMatcher" "new Matcher" -> "Matcher.AllOf"
In generated ...ComponentIds
namespace Entitas { public partial class XYZMatcher { public Matcher(int index) { } public override string ToString() { return ComponentIds.IdToString(indices[0]); } } }
Entitas 0.22.0 changed IReactiveSystem and IMultiReactiveSystem and renamed IStartSystem.Start to IInitializeSystem.Initialize.
Use the command line tool MigrationAssistant.exe
to automatically migrate IReactiveSystem.
Entitas 0.19.0 introduces a few breaking changes:
Added new e.OnComponentReplaced and removed all *WillBeRemoved events.
If you used group.OnEntityWillBeRemoved
, you could replace it either with
or with
If your generated component extensions are not compiling, find/replace WillRemoveComponent
with //WillRemoveComponent
to temporarily ignore the errors.
IReactiveSystem.Execute takes List<Entity> instead of Entity[]. Use the command line tool MigrationAssistant.exe
to automatically migrate.
Entitas 0.18.0 changes IReactiveSystem. To upgrade your source files, follow these steps
MigrationAssistant.exe
to automatically migrateEntitas 0.12.0 generates prefixed matchers based on the PoolAttribute and introduces some API changes. In your existing project with a Entitas version < 0.12.0 manually rename the following classes and methods.
pool.CreateSystem() -> pool.CreateExecuteSystem()
Now that you're prepared for integrating the latest version, delete your existing version of Entitas, EntitasCodeGenerator and EntitasUnity.
Entitas EntitasCodeGenerator EntitasUnity
Open the Unity preference panel and select Entitas. Check and update the path to the folder where the code generator will save all generated files. If you are using the PoolAttribute in your components, add all custom pool names used in your application. Make sure that all existing custom PoolAttributes call the base constructor with the same name as the class (without 'Attribute'). If you are not using the PoolAttribute in your components, you can skip this process.
Use the code generator and generate
Click the MenuItem "Entitas/Update API". All occurrences of the old Matcher will be updated to the new version, which is prefixed based on the PoolAttribute.
Delete all custom PoolAttributes
Beside features, Entitas 0.10.0 includes lots of renaming. If your current Entitas version is < 0.10.0, you might want to follow the next few simple renaming steps, to speed up the integration of the latest version of Entitas. In your existing project with a Entitas version < 0.10.0 manually rename the following classes and methods.
EntityRepository -> Pool EntityRepository.GetCollection() -> Pool.GetGroup() EntityCollection -> Group EntityCollection.EntityCollectionChange -> Group.GroupChanged EntityRepositoryObserver -> GroupObserver EntityRepositoryObserver.EntityCollectionEventType -> GroupObserver.GroupEventType IEntityMatcher -> IMatcher IEntitySystem -> IExecuteSystem AllOfEntityMatcher -> AllOfMatcher EntityRepositoryAttribute -> PoolAttribute IReactiveSubEntitySystem -> IReactiveSystem ReactiveEntitySystem -> ReactiveSystem
EntityWillBeRemovedEntityRepositoryObserver -> DELETE IReactiveSubEntityWillBeRemovedSystem -> DELETE ReactiveEntityWillBeRemovedSystem -> DELETE
Now that you're prepared for integrating the latest version, delete your existing version of Entitas, EntitasCodeGenerator and ToolKit.
Entitas EntitasCodeGenerator ToolKit (unless you use classes from ToolKit. The new version of Entitas doesn't depend on ToolKit anymore)
IReactiveSubEntityWillBeRemovedSystem - Consider implementing ISystem & ISetPool and use group.OnEntityWillBeRemoved += foobar;
Use the code generator and generate