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
Assets
in 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
Assets
in the Unity toolbar.
Note: If you are creating a component, you must replace
PARENT
in 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
ECTReferenceValidation
is used to validate Unity Object references.ECTBoolValidation
is 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.
-
ComponentGroup
is now referred to asComponentParent
. -
Branch
is now referred to asGroup
.Ex.
ComponentBranch
is nowComponentGroup
. -
Reference
is now referred to asSystemData
.Ex.
ReferenceBranch
is nowSystemDataGroup
. -
Overridable
System
property inComponent
is now the overridable methodGetSystem()
.Ex.
PlayerMovement
'sprotected override ISystem System
is nowprotected override ISystem GetSystem()
.
Syntax Redundancy Improvements
In cases where subclass names repeated their parent class's name, that name has been dropped.
-
Entity
andComponent.Parent
subclassesEntityComponent
andChildComponent
replaced withSystem
.Ex.
PlayerEntity.EntityComponent
is nowPlayerEntity.Component
. -
Component
subclassComponentSystem
replaced withSystem
.Ex.
PlayerMovement.ComponentSystem
is nowPlayerMovement.System
. -
Component
subclassComponentGroup
replaced withParent
Ex.
PlayerEntity.EntityComponent.ComponentGroup
is nowPlayerEntity.Component.Parent
.