GKComponentSystem<TComponent>.AddComponent Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
AddComponent(GKEntity) |
Adds, to the component system, all components from |
AddComponent(TComponent) |
Adds the specified |
AddComponent(GKEntity)
Adds, to the component system, all components from entity
that match the component class for the component system.
[Foundation.Export("addComponentWithEntity:")]
public virtual void AddComponent (GameplayKit.GKEntity entity);
abstract member AddComponent : GameplayKit.GKEntity -> unit
override this.AddComponent : GameplayKit.GKEntity -> unit
Parameters
- entity
- GKEntity
The entity in which to search for compatible components to add.
- Attributes
Applies to
AddComponent(TComponent)
Adds the specified component
to the component system.
[Foundation.Export("addComponent:")]
public virtual void AddComponent (TComponent component);
abstract member AddComponent : 'Component -> unit
override this.AddComponent : 'Component -> unit
Parameters
- component
- TComponent
The component to add.
- Attributes
Remarks
App developers must ensure that the specified component is of the same class as the component system.