|
@@ -51,7 +51,7 @@ public class MyProcessor : EntityProcessor<MyComponent>
|
|
|
|
|
|
|
|
### Additional Note
|
|
### Additional Note
|
|
|
An `EntityComponent` can currently not be drag-dropped onto an entity in Game Studio.
|
|
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.
|
|
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_).
|
|
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
|
|
#### ComponentCategory
|
|
|
By default, your components will be listed in the category "Miscellaneous".
|
|
By default, your components will be listed in the category "Miscellaneous".
|
|
|
By adding the `ComponentCategory` attribute, a different category can be chosen.
|
|
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
|
|
```csharp
|
|
|
[ComponentCategory("My own components")]
|
|
[ComponentCategory("My own components")]
|
|
|
```
|
|
```
|
|
@@ -82,6 +82,24 @@ components are listed in Game Studio can be changed.
|
|
|
[ComponentOrder(2001)]
|
|
[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
|
|
### Separation of EntityComponent and Data
|
|
|
|
|
|
|
|
`EntityProcessor<TComponent>` is a shortcut for `EntityProcessor<TComponent, TComponent>`.
|
|
`EntityProcessor<TComponent>` is a shortcut for `EntityProcessor<TComponent, TComponent>`.
|