class ComponentManager
override fun onCreate() {
super.onCreate()
componentManager.registerComponent<MyComponent>(MyComponent.Companion)
}
| Name | Summary |
|---|---|
ComponentManager | constructor() |
| Name | Summary |
|---|---|
assertComponent | fun assertComponent(clazz: KClass<*>) Asserts that a component class is registered. |
checkComponent | fun checkComponent(clazz: KClass<*>): Boolean Checks if a component class is registered. |
createInstance | fun <T> createInstance(clazz: KClass<>): <Error class: unknown class><T, Boolean> Creates an instance of a component without associating it with an entity. fun <T> createInstance(clazz: KClass<>, entID: Long): <Error class: unknown class><T, Boolean> Creates an instance of a component for a specific entity. |
registerComponent | inline fun <T : ComponentBase> registerComponent(companionObjectInstance: ComponentCompanion, sendRate: SendRate = SendRate.DEFAULT) Registers a component with the ComponentManager using reified type parameters. fun registerComponent(clazz: KClass<*>, name: String, sendRate: SendRate, companionObjectInstance: ComponentCompanion) This method registers a component class with the ComponentManager, making it available for use with entities. It also registers the component’s attributes with the DataModel and configures metadata settings. |