@@ -48,52 +48,7 @@ It's recommended to build your entire project around these life cycle methods.
4848
4949<img src =" https://raw.githubusercontent.com/elraccoone/unity-entity-component-system/master/.github/WIKI/lifecycle.png " width =" 100% " ></br >
5050
51- ## Basic Example Usage
52-
53- Basic example usage of some of the ECS features.
54-
55- ``` cs
56- public class MainController : Controller {
57- [Injected ] private AiSystem aiSystem ;
58-
59- public override void OnInitialize () {
60- this .Register (typeof (EnemySystem ), typeof (AiSystem ), typeof (AudioService ));
61- var _myAsset = this .GetAsset <MyAssetType >(" MyAssetName" );
62- }
63- }
64-
65- public class EnemyComponent : EntityComponent <EnemyComponent , EnemySystem > {
66- [Referenced ] public BoxCollider collider ;
67- [Protected ] public float speed = 1 ;
68-
69- public int level ;
70- }
71-
72- public class EnemySystem : EntitySystem <EnemySystem , EnemyComponent > {
73- [Injected ] private AiSystem aiSystem ;
74- [Injected ] private AudioService AudioService ;
75- [Injected ] private MainController mainController ;
76-
77- public override void OnEntityInitialized (EnemyComponent entity ) {
78- if (entity .level > 5 )
79- this .aiSystem .Trigger (entity );
80- }
81-
82- public override void OnUpdate () {
83- var _delta = Time .deltaTime ;
84- foreach (var _entity in this .entities )
85- _entity .AddPosition (_delta * _entity .speed , 0 , 0 );
86- }
87- }
88-
89- public class AudioService : Service <AudioService > {
90- public void Play (string audioClipName ) {
91- // ...
92- }
93- }
94- ```
95-
96- ## Meta Data
51+ ## Classes, Methods and Properties
9752
9853Use build in file generator to create new instances for any of these types.
9954
0 commit comments