API reference
API reference
Select your platform
No SDKs available
No versions available

ComponentRegistration

ComponentRegistration

class ComponentRegistration(val clazz: KClass<out ComponentBase>, val companionObjectInstance: ComponentCompanion, val sendRate: SendRate = SendRate.DEFAULT)
ComponentRegistration is used to register components when creating a SpatialFeature. It is generally used and returned in a list in the SpatialFeature.componentsToRegister() method. It is recommeded to create a ComponentRegistration using the static createConfig() method.
Example:
override fun componentsToRegister(): List<ComponentRegistration> {
  return listOf(
      ComponentRegistration.createConfig<Audio>(Audio.Companion),
      ComponentRegistration.createConfig<Video>(Video.Companion))
 }

Constructors

NameSummary
ComponentRegistration
constructor(clazz: KClass<out ComponentBase>, companionObjectInstance: ComponentCompanion, sendRate: SendRate = SendRate.DEFAULT)

Types

NameSummary
Companion
object Companion

Properties

NameSummary
clazz
val clazz: KClass<out ComponentBase>

The Kotlin class of the component being registered
companionObjectInstance
val companionObjectInstance: ComponentCompanion

The companion object instance for the component, which provides metadata about the component’s attributes and dependencies
sendRate
val 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

Companion

object Companion

Functions

NameSummary
createConfig
inline fun <T : ComponentBase> createConfig(companionObjectInstance: ComponentCompanion, sendRate: SendRate = SendRate.DEFAULT): ComponentRegistration

Creates a ComponentRegistration configuration for the specified component type. This is generally used and returned in a list in the SpatialFeature.componentsToRegister() method.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon