Skip to content

Commit e1c81f3

Browse files
Updated documentation
1 parent 40033f7 commit e1c81f3

File tree

2 files changed

+40
-5
lines changed

2 files changed

+40
-5
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
custom:
2-
- https://jeffreylanters.nl/donate
3-
- https://paypal.me/jeffreylanters
2+
- https://jeffreylanters.nl/sponsor

README.md

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ A better approach to game design that allows you to concentrate on the actual pr
2020

2121
</br></br>
2222

23-
[![npm](https://img.shields.io/badge/sponsor_the_project-donate-E12C9A.svg?style=for-the-badge)](https://paypal.me/jeffreylanters)
23+
[![npm](https://img.shields.io/badge/sponsor_the_project-donate-E12C9A.svg?style=for-the-badge)](https://jeffreylanters.nl/sponsor)
2424

2525
Hi! My name is Jeffrey Lanters, thanks for checking out my modules! I've been a Unity developer for years when in 2020 I decided to start sharing my modules by open-sourcing them. So feel free to look around. If you're using this module for production, please consider donating to support the project. When using any of the packages, please make sure to **Star** this repository and give credit to **Jeffrey Lanters** somewhere in your app or game. Also keep in mind **it it prohibited to sublicense and/or sell copies of the Software in stores such as the Unity Asset Store!** Thanks for your time.
2626

@@ -179,8 +179,6 @@ public class MovementComponent : Component<MovementComponent, MovementSystem> {
179179
}
180180
``` -->
181181

182-
_The components section of the documentation is in process!_
183-
184182
### Systems
185183

186184
**Introduction:** 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.
@@ -189,6 +187,42 @@ _The components section of the documentation is in process!_
189187
public class MovementSystem : System<MovementSystem, MovementComponent> { }
190188
```
191189

190+
**Virtual On Initialize:** 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.
191+
192+
```csharp
193+
public class MovementSystem : System<MovementSystem, MovementComponent> {
194+
public override void OnInitialize () { }
195+
}
196+
```
197+
198+
**Virtual On Initialized:** 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.
199+
200+
```csharp
201+
public class MovementSystem : System<MovementSystem, MovementComponent> {
202+
public override void OnInitialized () { }
203+
}
204+
```
205+
206+
**Virtual On Enabled:** 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.
207+
208+
```csharp
209+
public class MovementSystem : System<MovementSystem, MovementComponent> {
210+
public override void OnEnabled () { }
211+
}
212+
```
213+
214+
<!-- TODO OnEntityInitialzed, OnEntityEnabled, OnPhysics, ShouldUpdate, OnUpdate, OnRender, OnDrawGui, OnDrawGizmos, OnDisabled, OnEntityDisabled, OnEntityWillDestory -->
215+
216+
**Checking wether an Entity is enabled:** 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.
217+
218+
```csharp
219+
public class MovementSystem : System<MovementSystem, MovementComponent> {
220+
private void SomeMethod () {
221+
if (this.entity.isEnabled == true) { }
222+
}
223+
}
224+
```
225+
192226
**Injection:** 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.
193227

194228
```csharp
@@ -218,6 +252,8 @@ _The systems section of the documentation is in process!_
218252
public class AudioService : Service<AudioService> { }
219253
```
220254

255+
<!-- TODO OnInitialize, OnInitialized, OnDrawGui, OnDrawGizmos -->
256+
221257
**Injection:** The [Service](#services) 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.
222258

223259
```csharp

0 commit comments

Comments
 (0)