Skip to content

Releases: knowlife4/ECT

Release v1.0.0

10 Mar 17:51
Compare
Choose a tag to compare

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.


Documentation

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.


Documentation

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.


Documentation

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.


Documentation

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 old ECTValidation.

Static Validation Methods

The class ECTValidation is now a static class for IValidation helper methods.

  • ValidateReference(Object) and ValidateReference(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.

Documentation

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 as ComponentParent.

  • Branch is now referred to as Group.

    Ex. ComponentBranch is now ComponentGroup.

  • Reference is now referred to as SystemData.

    Ex. ReferenceBranch is now SystemDataGroup.

  • Overridable System property in Component is now the overridable method GetSystem().

    Ex. PlayerMovement's protected override ISystem System is now protected override ISystem GetSystem().

Syntax Redundancy Improvements

In cases where subclass names repeated their parent class's name, that name has been dropped.

  • Entity and Component.Parent subclasses EntityComponent and ChildComponent replaced with System.

    Ex. PlayerEntity.EntityComponent is now PlayerEntity.Component.

  • Component subclass ComponentSystem replaced with System.

    Ex. PlayerMovement.ComponentSystem is now PlayerMovement.System.

  • Component subclass ComponentGroup replaced with Parent

    Ex. PlayerEntity.EntityComponent.ComponentGroup is now PlayerEntity.Component.Parent.


Documentation