Skip to content

Commit 3e7ea62

Browse files
Minor documentation changes
1 parent 2880db7 commit 3e7ea62

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,15 @@ While it is recommended to move as much logic into [Services](#services) and [Sy
157157
[Components](#components) are responsible for housing the data of your entities, and should consist of nothing more than that. All properties should be public and will be accessible to all [Systems](#systems) and [Controllers](#controllers) since there is no need for privates. [Components](#components) should be added to your Entities (GameObjects) in the Scene, an Entity is not limited to one [Components](#components) and can hold as many as needed.
158158

159159
```csharp
160-
public class MovementComponent : Component<MovementComponent, MovementSystem> { }
160+
public class MovementComponent : EntityComponent<MovementComponent, MovementSystem> { }
161161
```
162162

163163
### Public Properties
164164

165165
Public properties are the heart of your [Components](#components), and are here to provide data for the [Systems](#systems) to use. Properties can be added to [Components](#components) like in any other class and can consist of any kind of type.
166166

167167
```csharp
168-
public class MovementComponent : Component<MovementComponent, MovementSystem> {
168+
public class MovementComponent : EntityComponent<MovementComponent, MovementSystem> {
169169
public float speed;
170170
public Vector3 targetPosition;
171171
public int[] ids;
@@ -178,7 +178,7 @@ public class MovementComponent : Component<MovementComponent, MovementSystem> {
178178
Sometimes you want to hide properties from the Unity Editor when they are, for example are managed by the [Systems](#systems). By flagging these properties with the Protected attribute, it will no longer shows up in the Unity Editor, but is still accessible by the [Systems](#systems).
179179

180180
```csharp
181-
public class MovementComponent : Component<MovementComponent, MovementSystem> {
181+
public class MovementComponent : EntityComponent<MovementComponent, MovementSystem> {
182182
[Protected] public float currentSpeed;
183183
}
184184
```
@@ -198,15 +198,15 @@ public class MovementComponent : Component<MovementComponent, MovementSystem> {
198198
The [Systems](#systems) are responsible for controlling all of your Entity's [Components](#components) and are the closest you'll get of what you're used to when working with MonoBehaviours. The entire life cycles of your Entities are managed in here.
199199

200200
```csharp
201-
public class MovementSystem : System<MovementSystem, MovementComponent> { }
201+
public class MovementSystem : EntitySystem<MovementSystem, MovementComponent> { }
202202
```
203203

204204
### Virtual On Initialize
205205

206206
The [System](#systems) consists of an OnInitialize virtual method. This method can be overwritten and will be invoked during the very start of your Application. During this cycle properties with the Injected and Asset attribute are being assigned. This cycle can be used to create instances or pre-set properties. Keep in mind references to other [System](#systems) and [Services](#services) are yet to be assigned and are not available at this point.
207207

208208
```csharp
209-
public class MovementSystem : System<MovementSystem, MovementComponent> {
209+
public class MovementSystem : EntitySystem<MovementSystem, MovementComponent> {
210210
public override void OnInitialize () { }
211211
}
212212
```
@@ -216,7 +216,7 @@ public class MovementSystem : System<MovementSystem, MovementComponent> {
216216
The [System](#systems) consists of an OnInitialized virtual method. This method can be overwritten and will be invoked when all [System](#systems) and [Services](#services) did initialize, and all the properties with the Injected and Asset attributes are assigned.
217217

218218
```csharp
219-
public class MovementSystem : System<MovementSystem, MovementComponent> {
219+
public class MovementSystem : EntitySystem<MovementSystem, MovementComponent> {
220220
public override void OnInitialized () { }
221221
}
222222
```
@@ -226,7 +226,7 @@ public class MovementSystem : System<MovementSystem, MovementComponent> {
226226
The [System](#systems) consists of an OnEnabled virtual method. This method can be overwritten and will be invoked when all [System](#systems) and [Services](#services) are initialized or when the [System](#systems) is enabled after being disabled.
227227

228228
```csharp
229-
public class MovementSystem : System<MovementSystem, MovementComponent> {
229+
public class MovementSystem : EntitySystem<MovementSystem, MovementComponent> {
230230
public override void OnEnabled () { }
231231
}
232232
```
@@ -238,7 +238,7 @@ public class MovementSystem : System<MovementSystem, MovementComponent> {
238238
To check whether Entities are enable or disabled, the [Component](#components) consists of a property isEnabled. Getting the value will return a boolean informing if the Entity is enabled or not.
239239

240240
```csharp
241-
public class MovementSystem : System<MovementSystem, MovementComponent> {
241+
public class MovementSystem : EntitySystem<MovementSystem, MovementComponent> {
242242
private void SomeMethod () {
243243
if (this.entity.isEnabled == true) { }
244244
}
@@ -250,7 +250,7 @@ public class MovementSystem : System<MovementSystem, MovementComponent> {
250250
The [System](#systems) allows the use of the Injected attribute on properties to automatically assign the values of referenced [Systems](#Systems), [Services](#Services) and [Controllers](#controllers), making all public methods and properties accessible. These properties are assigned during the OnInitialize cycle and are available for use at the OnInitialized cycle.
251251

252252
```csharp
253-
public class MovementSystem : System<MovementSystem, MovementComponent> {
253+
public class MovementSystem : EntitySystem<MovementSystem, MovementComponent> {
254254
[Injected] private MainController mainController;
255255
[Injected] private HealthSystem healthSystem;
256256
[Injected] private AudioService audioService;
@@ -262,7 +262,7 @@ public class MovementSystem : System<MovementSystem, MovementComponent> {
262262
The [System](#system) allows the use of the Asset attribute on properties to automatically assign the values of referenced Assets. Assets can be assigned on the [Controller](#controllers) instance in your Scene. When assigning using the empty contructor, the property's name will be used for searching the Asset, to find an Asset by it's name, use the string overload. All types of UnityEngine's Object can be used in these fields. These properties are assigned during the OnInitialize cycle and are available for use at the OnInitialized cycle. When an asset is not found, an error is thrown.
263263

264264
```csharp
265-
public class MovementSystem : System<MovementSystem, MovementComponent> {
265+
public class MovementSystem : EntitySystem<MovementSystem, MovementComponent> {
266266
[Asset] private GameObject playerPrefab;
267267
[Asset ("ShopDialog")] private NpcDialog npcDialog;
268268
}

0 commit comments

Comments
 (0)