override fun componentsToRegister(): List<ComponentRegistration> {
return listOf(
ComponentRegistration.createConfig<Audio>(Audio.Companion),
ComponentRegistration.createConfig<Video>(Video.Companion))
}
class ComponentRegistration(
val clazz: KClass<out ComponentBase>,
val companionObjectInstance: ComponentCompanion,
val sendRate: SendRate = SendRate.DEFAULT,
)ComponentRegistration
(
clazz
, companionObjectInstance
, sendRate
)
|
Signature
constructor(
clazz: KClass<out ComponentBase>,
companionObjectInstance: ComponentCompanion,
sendRate: SendRate = SendRate.DEFAULT,
)Parameters companionObjectInstance: ComponentCompanion
The companion object instance for the component, which provides metadata about the component's attributes and dependencies
sendRate: SendRate
The network synchronization rate and reliability settings for this component, determining how often and how reliably component updates are sent over the network
Returns ComponentRegistration |
clazz
: KClass<out ComponentBase>
[Get] |
The Kotlin class of the component being registered
Signature
val clazz: KClass<out ComponentBase> |
companionObjectInstance
: ComponentCompanion
[Get] |
The companion object instance for the component, which provides metadata about the component's attributes and dependencies
Signature
val companionObjectInstance: ComponentCompanion |
sendRate
: SendRate
[Get] |
The network synchronization rate and reliability settings for this component, determining how often and how reliably component updates are sent over the network
Signature
val sendRate: SendRate |
createConfig
(
companionObjectInstance
, sendRate
)
|
Creates a ComponentRegistration configuration for the specified component type. This is generally used and returned in a list in the SpatialFeature.componentsToRegister() method.
Example:
override fun componentsToRegister(): List<ComponentRegistration> {
return listOf(
ComponentRegistration.createConfig<Audio>(Audio.Companion),
ComponentRegistration.createConfig<Video>(Video.Companion))
}
Signature
inline fun <T : ComponentBase> createConfig(
companionObjectInstance: ComponentCompanion,
sendRate: SendRate = SendRate.DEFAULT,
): ComponentRegistrationParameters sendRate: SendRate
The network synchronization settings for this component
|