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 MonoBehaviour, and IPunObservable.
Classes | |
class | SynchronizedLayer |
class | SynchronizedParameter |
Public Types | |
enum | ParameterType { ParameterType.Float = 1, ParameterType.Int = 3, ParameterType.Bool = 4, ParameterType.Trigger = 9 } |
enum | SynchronizeType { SynchronizeType.Disabled = 0, SynchronizeType.Discrete = 1, SynchronizeType.Continuous = 2 } |
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... | |
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.
|
strong |
|
strong |
void PhotonAnimatorView.CacheDiscreteTriggers | ( | ) |
Caches the discrete triggers values for keeping track of raised triggers, and will be reseted after the sync routine got performed
bool PhotonAnimatorView.DoesLayerSynchronizeTypeExist | ( | int | layerIndex | ) |
Check if a specific layer is configured to be synchronize
layerIndex | Index of the layer. |
bool PhotonAnimatorView.DoesParameterSynchronizeTypeExist | ( | string | name | ) |
Check if the specified parameter is configured to be synchronized
name | The name of the parameter. |
SynchronizeType PhotonAnimatorView.GetLayerSynchronizeType | ( | int | layerIndex | ) |
Gets the type how the layer is synchronized
layerIndex | Index of the layer. |
SynchronizeType PhotonAnimatorView.GetParameterSynchronizeType | ( | string | name | ) |
Gets the type how the parameter is synchronized
name | The name of the parameter. |
List<SynchronizedLayer> PhotonAnimatorView.GetSynchronizedLayers | ( | ) |
Get a list of all synchronized layers
List<SynchronizedParameter> PhotonAnimatorView.GetSynchronizedParameters | ( | ) |
Get a list of all synchronized parameters
void PhotonAnimatorView.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.sendRateOnSerialize 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 PhotonAnimatorView.SetLayerSynchronized | ( | int | layerIndex, |
SynchronizeType | synchronizeType | ||
) |
Sets the how a layer should be synchronized
layerIndex | Index of the layer. |
synchronizeType | Disabled/Discrete/Continuous |
void PhotonAnimatorView.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 |