Class ComponentBroadcasterService<ServiceType, ObserverType>
Abstract class for services that manage IComponentBroadcaster
Implements
Inherited Members
Namespace: Microsoft.MixedReality.SpectatorView
Assembly: cs.temp.dll.dll
Syntax
public abstract class ComponentBroadcasterService<ServiceType, ObserverType> : Singleton<ServiceType>, IComponentBroadcasterService where ServiceType : Singleton<ServiceType> where ObserverType : UnityEngine.Component, IComponentObserver
Type Parameters
Name | Description |
---|---|
ServiceType | The service type used for defining a singleton of said service |
ObserverType | The IComponentObserver type that the service manages |
Methods
Create(GameObject)
Ensures that the IComponentObserver type defined for the service exists for the provided game object
Declaration
public virtual void Create(GameObject mirror)
Parameters
Type | Name | Description |
---|---|---|
GameObject | mirror |
Destroy(GameObject)
Ensures that the IComponentObserver type defined for the service is removed from the provided game object
Declaration
public virtual void Destroy(GameObject mirror)
Parameters
Type | Name | Description |
---|---|---|
GameObject | mirror |
GetID()
Returns a unique id associated with the service
Declaration
public abstract ShortID GetID()
Returns
Type | Description |
---|---|
ShortID | unique id |
LerpRead(BinaryReader, GameObject, Single)
Relays the IComponentObserver defined for the game object a network message for interpolating
Declaration
public virtual void LerpRead(BinaryReader message, GameObject mirror, float lerpVal)
Parameters
Type | Name | Description |
---|---|---|
BinaryReader | message | network message |
GameObject | mirror | game object to broadcast |
Single | lerpVal | interpolation value |
Read(SocketEndpoint, BinaryReader, GameObject)
Ensures an IComponentObserver exists on the provided game object and relays it a network message
Declaration
public virtual void Read(SocketEndpoint sendingEndpoint, BinaryReader message, GameObject mirror)
Parameters
Type | Name | Description |
---|---|---|
SocketEndpoint | sendingEndpoint | Endpoint that sent the message |
BinaryReader | message | network message |
GameObject | mirror | game object to broadcast |
WriteHeader(BinaryWriter, IComponentBroadcaster, ComponentBroadcasterChangeType)
Writes IComponentBroadcaster information to a network message for sending to other devices
Declaration
public void WriteHeader(BinaryWriter message, IComponentBroadcaster component, ComponentBroadcasterChangeType changeType = ComponentBroadcasterChangeType.Updated)
Parameters
Type | Name | Description |
---|---|---|
BinaryWriter | message | network message to send |
IComponentBroadcaster | component | component that has changed |
ComponentBroadcasterChangeType | changeType | type of changed that occurred for the specified component |
WriteHeader(BinaryWriter, TransformObserver, ComponentBroadcasterChangeType)
Writes TransformObserver information to a network message for sending to other devices
Declaration
public void WriteHeader(BinaryWriter message, TransformObserver TransformObserver, ComponentBroadcasterChangeType changeType = ComponentBroadcasterChangeType.Updated)
Parameters
Type | Name | Description |
---|---|---|
BinaryWriter | message | network message to send |
TransformObserver | TransformObserver | transform that has changed |
ComponentBroadcasterChangeType | changeType | type of changed that occurred for the specified component |