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
+12-16Lines changed: 12 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,7 @@ It's recommended to build your entire project around these life cycle methods.
64
64
publicclassMainController : Controller { }
65
65
```
66
66
67
-
**Virtual OnInitialize:** 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 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).
68
68
69
69
```csharp
70
70
publicclassMainController : Controller {
@@ -77,44 +77,44 @@ public class MainController : Controller {
77
77
}
78
78
```
79
79
80
-
**Virtual OnInitialized:** 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 [injectables](#Injectables) and [assets](#Assets) properties are assigned.
81
81
82
82
```csharp
83
83
publicclassMainController : Controller {
84
84
publicoverridevoidOnInitialized () { }
85
85
}
86
86
```
87
87
88
-
**Virtual OnUpdate:** 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.
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 {
100
-
publicvoidDoSomething () {
101
-
this.SetSystemEnabled<MovementSystem>(true);
102
-
this.SetSystemEnabled<InteractableSystem>(false);
100
+
publicvoidSomeMethod () {
101
+
this.SetSystemEnabled<MovementSystem>(true);
102
+
this.SetSystemEnabled<InteractableSystem>(false);
103
103
}
104
104
}
105
105
```
106
106
107
-
**Is System Enabled:** To check wether [systems](#Systems) are enable or disabled, the controller contains of a method IsSystemEnabled. Invoking the method will return a booling informing if the [systems](#Systems) is enabled or not.
107
+
**Checking Wether Systems Are Enabled:** To check wether [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.
108
108
109
109
```csharp
110
110
publicclassMainController : Controller {
111
-
publicvoidDoSomething () {
112
-
if (this.IsSystemEnabled<MovementSystem>()) { }
111
+
publicvoidSomeMethod () {
112
+
if (this.IsSystemEnabled<MovementSystem>()) { }
113
113
}
114
114
}
115
115
```
116
116
117
-
**Injection:** The controller can be be used as an [injected](#Injectables) property and allows insertion of other [injected](#Injectables)[systems](#Systems) and [services](#Services) properties. When being injected, all public methods and properties are accessibly.
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.
118
118
119
119
```csharp
120
120
publicclassMainController : Controller {
@@ -129,8 +129,4 @@ public class MainController : Controller {
0 commit comments