Releases: knowlife4/ECT
Release v1.0.0
Conceptual Changes
With 1.0 comes a single large conceptual change to ECT; entities are no longer used to represent Scene-Reference data.
The new purpose of entities is to tie all of the different data types together into a single cohesive unit.
This is due to the introduction of the SceneReference type which is now responsible for representing Scene-Reference data.
Feature Introductions
A few new and important features have been introduced in ECT v1.0
Editor Experience Improvements
Component Wizard
The Component Wizard is a tool used to create instances of components in the editor without having to mark them with [CreateAssetMenu].
Note: You can still use
[CreateAssetMenu]if you want to, but it is no longer required.
This menu can be accessed by right-clicking in the Project View and navigating to ECT > Component Wizard.
Your component's path in the Component Wizard's Component dropdown is determined by the class name.
Note: You can also get to this menu by pressing
Assetsin the Unity toolbar.
Script Templates
You can now create C# scripts and have them automatically populate with a default entity and component implementations.
This is done via right-clicking in the Project View and navigating to ECT > C# Script and selecting the corresponding option.
Note: You can also get to this menu by pressing
Assetsin the Unity toolbar.
Note: If you are creating a component, you must replace
PARENTin the class derivatives with the component's parent type.
SceneReferences
Scene References are a brand-new feature that allows components to define custom Scene-Reference data.
These can be queried in a system via the QuerySceneReference(out ISceneReference) method.
Component System Attribute
This attribute allows you to define a default system within a component.
This helps clean up systems by removing the need to define the constructor for the system manually.
Note: It is still necessary to define the system constructor if you are creating a component with multiple different systems.
Validation Improvements
The ECTValidation struct type has been replaced with IValidation interface allowing custom validation types.
This was done to more accurately validate Unity Object references, though it can be used to define your own custom validation types.
Validation Types
ECTReferenceValidationis used to validate Unity Object references.ECTBoolValidationis the replacement for the oldECTValidation.
Static Validation Methods
The class ECTValidation is now a static class for IValidation helper methods.
ValidateReference(Object)andValidateReference(Object, out Object)are used to validate a Unity Object reference.ValidateReferences(params Object[])is use to validate a set of Unity Object References.ValidateMany(params IValidation[])is used to validate a set of other validations.
ECTConstructors
ECTConstructors are used to dynamically generate a constructor from a System.Type,
Improved Syntax
Overall syntax improvements aimed at making the process of writing/understanding Entities, Components, and Systems easier.
Improved Readability
Many classes and class members have been renamed for simplicity and consistency.
-
ComponentGroupis now referred to asComponentParent. -
Branchis now referred to asGroup.Ex.
ComponentBranchis nowComponentGroup. -
Referenceis now referred to asSystemData.Ex.
ReferenceBranchis nowSystemDataGroup. -
Overridable
Systemproperty inComponentis now the overridable methodGetSystem().Ex.
PlayerMovement'sprotected override ISystem Systemis nowprotected override ISystem GetSystem().
Syntax Redundancy Improvements
In cases where subclass names repeated their parent class's name, that name has been dropped.
-
EntityandComponent.ParentsubclassesEntityComponentandChildComponentreplaced withSystem.Ex.
PlayerEntity.EntityComponentis nowPlayerEntity.Component. -
ComponentsubclassComponentSystemreplaced withSystem.Ex.
PlayerMovement.ComponentSystemis nowPlayerMovement.System. -
ComponentsubclassComponentGroupreplaced withParentEx.
PlayerEntity.EntityComponent.ComponentGroupis nowPlayerEntity.Component.Parent.