This class helps you to synchronize Mecanim animations Simply add the component to your GameObject and make sure that the PhotonAnimatorView is added to the list of observed components More...
Inherits MonoBehaviourPun, and IPunObservable.
Classes | |
class | SynchronizedLayer |
class | SynchronizedParameter |
Public Types | |
enum | ParameterType |
enum | SynchronizeType |
Public Member Functions | |
void | CacheDiscreteTriggers () |
Caches the discrete triggers values for keeping track of raised triggers, and will be reseted after the sync routine got performed More... | |
bool | DoesLayerSynchronizeTypeExist (int layerIndex) |
Check if a specific layer is configured to be synchronize More... | |
bool | DoesParameterSynchronizeTypeExist (string name) |
Check if the specified parameter is configured to be synchronized More... | |
List< SynchronizedLayer > | GetSynchronizedLayers () |
Get a list of all synchronized layers More... | |
List< SynchronizedParameter > | GetSynchronizedParameters () |
Get a list of all synchronized parameters More... | |
SynchronizeType | GetLayerSynchronizeType (int layerIndex) |
Gets the type how the layer is synchronized More... | |
SynchronizeType | GetParameterSynchronizeType (string name) |
Gets the type how the parameter is synchronized More... | |
void | SetLayerSynchronized (int layerIndex, SynchronizeType synchronizeType) |
Sets the how a layer should be synchronized More... | |
void | SetParameterSynchronized (string name, ParameterType type, SynchronizeType synchronizeType) |
Sets the how a parameter should be synchronized More... | |
void | OnPhotonSerializeView (PhotonStream stream, PhotonMessageInfo info) |
Called by PUN several times per second, so that your script can write and read synchronization data for the PhotonView. More... | |
Additional Inherited Members | |
Properties inherited from MonoBehaviourPun | |
PhotonView | photonView [get] |
A cached reference to a PhotonView on this GameObject. More... | |
This class helps you to synchronize Mecanim animations Simply add the component to your GameObject and make sure that the PhotonAnimatorView is added to the list of observed components
When Using Trigger Parameters, make sure the component that sets the trigger is higher in the stack of Components on the GameObject than 'PhotonAnimatorView' Triggers are raised true during one frame only.
void CacheDiscreteTriggers | ( | ) |
Caches the discrete triggers values for keeping track of raised triggers, and will be reseted after the sync routine got performed
bool DoesLayerSynchronizeTypeExist | ( | int | layerIndex | ) |
Check if a specific layer is configured to be synchronize
layerIndex | Index of the layer. |
bool DoesParameterSynchronizeTypeExist | ( | string | name | ) |
Check if the specified parameter is configured to be synchronized
name | The name of the parameter. |
SynchronizeType GetLayerSynchronizeType | ( | int | layerIndex | ) |
Gets the type how the layer is synchronized
layerIndex | Index of the layer. |
SynchronizeType GetParameterSynchronizeType | ( | string | name | ) |
Gets the type how the parameter is synchronized
name | The name of the parameter. |
List<SynchronizedLayer> GetSynchronizedLayers | ( | ) |
Get a list of all synchronized layers
List<SynchronizedParameter> GetSynchronizedParameters | ( | ) |
Get a list of all synchronized parameters
void OnPhotonSerializeView | ( | PhotonStream | stream, |
PhotonMessageInfo | info | ||
) |
Called by PUN several times per second, so that your script can write and read synchronization data for the PhotonView.
This method will be called in scripts that are assigned as Observed component of a PhotonView.
PhotonNetwork.SerializationRate affects how often this method is called.
PhotonNetwork.SendRate affects how often packages are sent by this client.
Implementing this method, you can customize which data a PhotonView regularly synchronizes. Your code defines what is being sent (content) and how your data is used by receiving clients.
Unlike other callbacks, OnPhotonSerializeView only gets called when it is assigned to a PhotonView as PhotonView.observed script.
To make use of this method, the PhotonStream is essential. It will be in "writing" mode" on the client that controls a PhotonView (PhotonStream.IsWriting == true) and in "reading mode" on the remote clients that just receive that the controlling client sends.
If you skip writing any value into the stream, PUN will skip the update. Used carefully, this can conserve bandwidth and messages (which have a limit per room/second).
Note that OnPhotonSerializeView is not called on remote clients when the sender does not send any update. This can't be used as "x-times per second Update()".
Implements IPunObservable.
void SetLayerSynchronized | ( | int | layerIndex, |
SynchronizeType | synchronizeType | ||
) |
Sets the how a layer should be synchronized
layerIndex | Index of the layer. |
synchronizeType | Disabled/Discrete/Continuous |
void SetParameterSynchronized | ( | string | name, |
ParameterType | type, | ||
SynchronizeType | synchronizeType | ||
) |
Sets the how a parameter should be synchronized
name | The name of the parameter. |
type | The type of the parameter. |
synchronizeType | Disabled/Discrete/Continuous |