RealtimeView
RealtimeView
A component that manages a set of RealtimeComponents on a game object.
Static Fields
public int ExecutionOrder
Events
event Action<RealtimeView, int> ownerIDSelfDidChange
Dispatched when the ownerIDSelf value changes.
event Action<RealtimeView> didReplaceAllComponentModels
Dispatched after all of the components of this view have been initialized with a new Realtime model.
Fields
public SceneViewWillRegisterDelegate sceneViewWillRegisterWithRealtime
Called when a scene view is about to register with Realtime. Use this to return a different Realtime instance than whatever was assigned in the scene, like on scene views that were additively loaded. This should be set during Awake, and is called during Start.
Properties
string viewUUID { get; }
The UUID of a RealtimeView instance. This is used to associate scene objects across clients and sessions. For scene objects, it is pregenerated by the editor. For prefab objects, it is null. Any changes to it will break persistence.
bool isChildView { get; }
True if the view is a child view.
bool isRootView { get; }
True if the view is a root view (scene or prefab).
bool isPrefabView { get; }
True if the view is part of a prefab view hierarchy.
bool isSceneView { get; }
True if the view is part of a scene view hierarchy.
bool isRootSceneView { get; }
True if the view is a root scene view.
bool isRootPrefabView { get; }
True if the view is a root prefab view.
RealtimeView realtimeView { get; }
The RealtimeView that owns this component. Accessing this property before Start is unreliable.
Realtime realtime { get; }
The Realtime instance that is managing this component. On prefab views, this property is available after Awake. On scene views or their children, this is not available until Start.
Room room { get; }
The current room of the Realtime instance that is managing this component. This might be null if the Realtime instance hasn't connected yet. Accessing this property before Start is unreliable.
int ownerIDSelf { get; }
The client ID of the component owner.
int ownerIDInHierarchy { get; }
The client ID of the component's hierarchy owner (the root owner of the component).
bool isUnownedSelf { get; }
True if the component is not owned by any client.
bool isUnownedInHierarchy { get; }
True if the component and all of its parent views are not owned by any client.
bool isOwnedLocallySelf { get; }
True if the component is owned by the local client.
bool isOwnedLocallyInHierarchy { get; }
True if the component and all of its parent views are owned by the local client.
bool isOwnedRemotelySelf { get; }
True if the component is owned by a remote client.
bool isOwnedRemotelyInHierarchy { get; }
True if this component and all of its parent views are owned by a remote client.
bool preventOwnershipTakeover { get; set; }
If true, the model owner must clear ownership before another client can request it.
bool destroyWhenLastClientLeaves { get; set; }
If true, the model is destroyed when the last client in the room leaves.
bool destroyWhenOwnerLeaves { get; set; }
If true, the model is destroyed when the owner of the model leaves the room.
Methods
RealtimeView GetRootView()
Returns the root view of this view, or this view if it is the root.
RealtimeView GetParentView()
Returns the parent view of this view, or null if this is the root view.
void OnBeforeSerialize()
void OnAfterDeserialize()
void RequestOwnership()
Request ownership of the component.
void SetOwnership(int clientID)
Set ownership of the component.
void ClearOwnership()
Clear ownership of the component.
void RequestOwnershipOfSelfAndChildren()