Browse Source

Fix typos and add some cool stuff

Raphael Schmitz 2 years ago
parent
commit
fc8a1265fd
1 changed files with 20 additions and 2 deletions
  1. 20 2
      en/manual/engine/entity-component-model/usage.md

+ 20 - 2
en/manual/engine/entity-component-model/usage.md

@@ -51,7 +51,7 @@ public class MyProcessor : EntityProcessor<MyComponent>
 
 ### Additional Note
 An `EntityComponent` can currently not be drag-dropped onto an entity in Game Studio.  
-t has to be added by selecting an entity, and then clicking the "Add component" button  
+It has to be added by selecting an entity, and then clicking the "Add component" button  
 in the property grid.
 
 Alternatively, this can also be done in [code via `entity.Add(entityComponent)`](https://doc.stride3d.net/latest/en/api/Stride.Engine.Entity.html#Stride_Engine_Entity_Add_Stride_Engine_EntityComponent_).
@@ -70,7 +70,7 @@ By adding the `Display` attribute, a nicer name can be shown in Game Studio.
 #### ComponentCategory
 By default, your components will be listed in the category "Miscellaneous".  
 By adding the `ComponentCategory` attribute, a different category can be chosen.  
-If the chosen name does not exist yet, it ill be added to the list in Game Studio.  
+If the chosen name does not exist yet, it will be added to the list in Game Studio.  
 ```csharp
 [ComponentCategory("My own components")]
 ```
@@ -82,6 +82,24 @@ components are listed in Game Studio can be changed.
 [ComponentOrder(2001)]
 ```
 
+
+### Component Combinations
+By passing the types of other components to the `EntityProcessor` constructor,  
+it will only include entities _that also have those other components_.
+
+For example, the following `EntityProcessor` will only process entities which  
+have a `MyComponent`, `TransformComponent` and `AnimationComponent` on them.
+
+```csharp
+public class MyProcessor : EntityProcessor<MyComponent>
+{
+    public MyProcessor() : base(typeof(TransformComponent), typeof(AnimationComponent))
+    {
+    }
+}
+```
+
+
 ### Separation of EntityComponent and Data
 
 `EntityProcessor<TComponent>` is a shortcut for `EntityProcessor<TComponent, TComponent>`.