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
+54-1Lines changed: 54 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,59 @@ It is advised to look at the examples, which show the [bare bones required setup
34
34
35
35
If you are using unity it is recommended you just ignore everything here and use the instructions on the [ecsrx.unity repository](ttps://github.com/grofit/ecsrx.unity).
36
36
37
+
### Simple components
38
+
39
+
```csharp
40
+
publicclassHealthComponent : IComponent
41
+
{
42
+
publicintCurrentHealth { get; set; }
43
+
publicintMaxHealth { get; set; }
44
+
}
45
+
```
46
+
47
+
You implement the `IComponent` interface which marks the class as a component, and you can optionally implement `IDisposable` if you want to dispose stuff like so:
publicvoidExecute(IEntityentity) // Logic run whenever the above reaction occurs
79
+
{
80
+
entity.RemoveComponent<HealthComponent>();
81
+
entity.AddComponent<IsDeadComponent>();
82
+
}
83
+
}
84
+
```
85
+
86
+
Systems are conventional, so there are many built in types like `IReactToEntitySystem`, `IReactToGroupSystem`, `IManualSystem` and many others, but you can read about them in the [docs/systems](docs/systems.md), you can add your own conventional systems by extending `ISystem` and systems are handled for you by the `ISystemExecutor`.
87
+
88
+
Check the examples for more use cases, and the unity flavour of ecsrx which has more examples and demo projects, and drop into the gitter channel to ask any questions.
89
+
37
90
## Running Examples
38
91
39
92
If you want to run the examples then just clone it and open examples project in the `src` folder, then run the examples, I will try to add to as the library matures.
@@ -42,7 +95,7 @@ There are also a suite of tests which are being expanded as the project grows, i
42
95
43
96
## Docs
44
97
45
-
See the docs folder for more information. (This will grow)
98
+
See the [docs folder](docs) for more information. (This will grow)
0 commit comments