Class P2PManager
Used to perform networked procedures across all connected devices.
Hierarchy
Index
Methods
- ChangeScene
- DerigisterScene
- DestroyGameObject
- GetTrackable
- InstantiateGameObject
- OnInstantiateGameObject
- OnSceneChange
- RegisterBaseGameObject
- RegisterScene
Methods
Static ChangeScene
ChangeScene(sceneName: string, merge: boolean): void
- Defined in TableRealms.ts:261
- Changes the current scene across all connected devices.
Parameters
- sceneName: string
- The name of the new scene that should be loaded.
- merge: boolean
- When true the new scene will be additively loaded on top of already loaded scenes.
Returns void
Static DerigisterScene
DerigisterScene(sceneName: string): void
- Defined in TableRealms.ts:276
- Once a scene is registered, it can be deregistered with this method.
Parameters
- sceneName: string
- The name of the scene that is deregistered.
Returns void
Static DestroyGameObject
DestroyGameObject(entity: ut.Entity): void
- Defined in TableRealms.ts:327
- Destroyes an entity across all devices.
Parameters
- entity: ut.Entity
- The entity that should be destroyed.
Returns void
Static GetTrackable
GetTrackable(entity: ut.Entity): Trackable
- Defined in TableRealms.ts:300
- Returns the Trackable that is attached to an entity.
Parameters
- entity: ut.Entity
- The entity for which it’s trackable should be returned.
Returns Trackable
Static InstantiateGameObject
InstantiateGameObject(prefabName: string, playerId: string, position: Vector3, orientation: Quaternion, networkMovement: boolean): void
- Defined in TableRealms.ts:311
- Instantiates a new instance of a registered prefab across all devices.
Parameters
- prefabName: string
- The name of the game object that should be instantiated.
- playerId: string
- The player’s ID to whom this object belongs.
- position: Vector3
- The initial position of the entity.
- orientation: Quaternion
- The initial orientation of the entity.
- networkMovement: boolean
- If this is true the entity’s position and orientation will be automatically shared across all devices.
Returns void
Static OnInstantiateGameObject
OnInstantiateGameObject(prefabName: string, callback: function): void
- Defined in TableRealms.ts:319
- Register a callback that is executed whenever a prefab is instantiated.
Parameters
- prefabName: string
- The name of the prefab for which the callback should be executed.
- callback: function
- The callback that should be executed.
- (): void
- Returns void
- Returns void
Static OnSceneChange
OnSceneChange(sceneName: string, callback: function): void
- Defined in TableRealms.ts:284
- Register a callback that is executed whenever a scene change takes place.
Parameters
- sceneName: string
- The name of the scene for which the callback should be executed.
- callback: function
- The callback that should be executed.
- (): void
- Returns void
- Returns void
Static RegisterBaseGameObject
RegisterBaseGameObject(prefabName: string, gameObject: string): void
- Defined in TableRealms.ts:293
- Before instances of entities can be instantiated their prefab needs to be registered.
Parameters
- prefabName: string
- The name of the new prefab that is registered.
- gameObject: string
- This is the fully qualified name of the prefab that is registered.
Returns void
Static RegisterScene
RegisterScene(sceneName: string, scene: string): void
- Defined in TableRealms.ts:269
- Before scenes can be loaded they need to be registered.
Parameters
- sceneName: string
- The name of the new scene that is registered.
- scene: string
- This is the fully qualified name of the entity group (scene) that is registered.
Returns void