You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,13 +58,13 @@ It's recommended to build your entire project around these life cycle methods.
58
58
59
59
### Controllers
60
60
61
-
**Introduction:** The controller is the heart of your application, each application should consist of just one, commonly named the MainController. The Controller is the first entry point of the Entity Component System and is the place where all of your [systems](#systems) and [services](#services) are registered. Your controller should be attached to a game object in your scene.
61
+
**Introduction:** The Controller is the heart of your Application, each Application should consist of just one, commonly named the MainController. The Controller is the first entry point of the Entity Component System and is the place where all of your [Systems](#systems) and [Services](#services) are registered. Your Controller should be attached to a Game Object in your scene and will be marked to not be destroyed when switching scenes.
62
62
63
63
```csharp
64
64
publicclassMainController : Controller { }
65
65
```
66
66
67
-
**Virtual On Initialize:** The controller 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 none [injectables](#Injectables) or [assets](#Assets)are being assigned, it is important to invoke the Register method during this cycle since this is the only time in your application you can register [systems](#Systems) and [services](#Services).
67
+
**Virtual On Initialize:** The Controller 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, it is important to invoke the Register method during this cycle since this is the only time in your Application you can register [Systems](#systems) and [Services](#services).
68
68
69
69
```csharp
70
70
publicclassMainController : Controller {
@@ -77,23 +77,23 @@ public class MainController : Controller {
77
77
}
78
78
```
79
79
80
-
**Virtual On Initialized:** The controller consists of an OnInitialized virtual method. This method can be overwritten and will be invoked when all [systems](#Systems) and [services](#Services) did initialize and all [injectables](#Injectables)and [assets](#Assets) properties are assigned.
80
+
**Virtual On Initialized:** The Controller consists of an OnInitialized virtual method. This method can be overwritten and will be invoked when all [Systems](#systems) and [Services](#services) did initialize, and all the properties with the Injected and Asset attributes are assigned.
81
81
82
82
```csharp
83
83
publicclassMainController : Controller {
84
84
publicoverridevoidOnInitialized () { }
85
85
}
86
86
```
87
87
88
-
**Virtual On Update:** The controller consists of an OnUpdate virtual method. This method can be overwritten and will be invoked during the update cycle. This cycle will run once every frame, the controller's Update is invoked before the [system's](#Systems) and [service's](#Services) update cycles.
88
+
**Virtual On Update:** The Controller consists of an OnUpdate virtual method. This method can be overwritten and will be invoked during the Update cycle. This cycle will run once every frame, the Controller's Update is invoked before the [System's](#systems) and [Service's](#services) update cycles.
89
89
90
90
```csharp
91
91
publicclassMainController : Controller {
92
92
publicoverridevoidOnUpdate () { }
93
93
}
94
94
```
95
95
96
-
**Enabling Systems:** To enable or disable [systems](#Systems), the controller contains of a method EnableSystem which allows [systems](#Systems) to stop their life cycle methods such as OnUpdate, OnPhysics, OnDrawGui and others. You can provide the [system's](#System) type using a generic.
96
+
**Enabling Systems:** To enable or disable [Systems](#systems), the Controller contains of a method EnableSystem which allows [Systems](#systems) to stop their life cycle methods such as OnUpdate, OnPhysics, OnDrawGui and others. You can provide the [System's](#system) type using a generic.
97
97
98
98
```csharp
99
99
publicclassMainController : Controller {
@@ -104,7 +104,7 @@ public class MainController : Controller {
104
104
}
105
105
```
106
106
107
-
**Checking Whether Systems Are Enabled:** To check whether [systems](#Systems) are enable or disabled, the controller contains of a method IsSystemEnabled. Invoking the method will return a booling informing if the [system](#Systems) is enabled or not. You can provide the [system's](#System) type using a generic.
107
+
**Checking Whether Systems Are Enabled:** To check whether [Systems](#systems) are enable or disabled, the Controller contains of a method IsSystemEnabled. Invoking the method will return a boolean informing if the [System](#systems) is enabled or not. You can provide the [System's](#system) type using a generic.
108
108
109
109
```csharp
110
110
publicclassMainController : Controller {
@@ -114,7 +114,7 @@ public class MainController : Controller {
114
114
}
115
115
```
116
116
117
-
**Injection:** The controller allows insertion of [injected](#Injectables)[systems](#Systems) and [services](#Services) properties. When being injected, all public methods and properties are accessibly. When adding the attribute to any of these type of fields, they will be assigned during the OnInitialze cycle. All public methods and properties within these properties are accessibly like normal.
117
+
**Injection:** The Controller allows the use of the Injected attribute on properties to automatically assign the values of referenced [Systems](#Systems) and [Services](#Services), making all public methods and properties accessible. These properties are assigned during the OnInitialize cycleand are available for use at the OnInitialized cycle.
118
118
119
119
```csharp
120
120
publicclassMainController : Controller {
@@ -123,7 +123,7 @@ public class MainController : Controller {
123
123
}
124
124
```
125
125
126
-
**Notes:** While it is recommended to move as much logic into [services](#Services) and [systems](#Systems), it is possible to let your controller house any functionality. If you use the controller for this purpose, try to keep it down to only application wide and core functionality.
126
+
**Notes:** While it is recommended to move as much logic into [Services](#services) and [Systems](#systems), it is possible to let your Controller house any functionality. If you use the Controller for this purpose, try to keep it down to only Application wide and core functionality.
0 commit comments