addComponent
TypeScriptaddComponent(component: GKComponent): voidSwift declarationfunc addComponent(_ component: GKComponent)class · iOS 9.0+ · SDK 27.1
class GKEntityaddComponent(component: GKComponent): voidSwift declarationfunc addComponent(_ component: GKComponent)static init(): GKEntitySwift declarationinit()update(seconds: number): voidSwift declarationfunc update(deltaTime seconds: TimeInterval)get components(): Array<GKComponent>Swift declarationvar components: [GKComponent] { get }removeComponent(componentClass: string): voidSwift declarationfunc removeComponent<ComponentType>(ofType componentClass: ComponentType.Type) where ComponentType : GKComponentRemoves the component of the indicates class from this entity - Parameter ofType: the type of component you want to remove
component(componentClass: string): (GKComponent) | nullSwift declarationfunc component<ComponentType>(ofType componentClass: ComponentType.Type) -> ComponentType? where ComponentType : GKComponentGets the component of the indicated class. Returns nil if entity does not have this component - Parameter ofType: the type of the component you want to get
No declarations were skipped in this snapshot.