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

FeatureManager Class

Modifiers: final
Manages a collection of SpatialFeature instances for your Spatial SDK activity.
The FeatureManager is responsible for:
  • Storing and providing access to registered features
  • Managing feature lifecycle events
  • Checking feature dependencies
  • Registering components and systems from features
Example usage of registering features:
// ImmersiveActivity.kt (your immersive Spatial SDK activity)
override fun registerFeatures(): List<SpatialFeature> {
  return listOf(
    VRFeature(),
    IsdkFeature(),
    PhysicsFeature())
}

Example usage of accessing features:
// ImmersiveActivity.kt (your immersive Spatial SDK activity)
fun myHelperFunction() {
  val toolkitFeature = featureManager.tryFindFeature<ToolkitFeature>()
  ...
}

Signature

class FeatureManager(val features: List<SpatialFeature>)

Constructors

FeatureManager ( features ) : FeatureManager
Signature
constructor(features: List<SpatialFeature>)
Parameters
features: List
The list of SpatialFeature instances managed by this FeatureManager

Properties

features : List
[Get]
The list of SpatialFeature instances managed by this FeatureManager
Signature
val features: List<SpatialFeature>

Functions

findFeature ( clazz ) : FeatureManager
Finds a SpatialFeature of the specified type or throws an exception if not found.
Signature
fun <T : SpatialFeature> findFeature(clazz: KClass<T>): T
Parameters
clazz: KClass
The KClass of the feature to find
Returns
The found feature instance
Throws
Exception
if the feature is not found
findFeature () : FeatureManager
Finds a feature of the specified SpatialFeature class or throws an exception if not found.
Signature
inline fun <T : SpatialFeature> findFeature(): T
Returns
The found feature instance
Throws
Exception
if the feature is not found
tryFindFeature ( clazz ) : FeatureManager?
Attempts to find a SpatialFeature of the specified type, or null if no matching feature is found.
Signature
fun <T : SpatialFeature> tryFindFeature(clazz: KClass<T>): T?
Parameters
clazz: KClass
The KClass of the feature to find
Returns
The found feature instance, or null if not found
tryFindFeature () : FeatureManager?
Attempts to find a feature of the specified SpatialFeature class.
Signature
inline fun <T : SpatialFeature> tryFindFeature(): T?
Returns
The found feature instance, or null if not found
Did you find this page helpful?
Thumbs up icon
Thumbs down icon