Hi,
I want to synchronize animations with networkView, i am now synchronizing the animator state using networkView.PRC function, below is the example code:
[RPC]
void PlayAnimation(bool play, float tm)
{
_animator.SetBool("Play", play);
}
void Update ()
{
if(Input.GetKeyDown(KeyCode.F))
{
networkView.RPC("EnableAnimation", RPCMode.AllBuffered, false);
}
if(Input.GetKeyDown(KeyCode.G))
{
networkView.RPC ("EnableAnimation", RPCMode.AllBuffered, true);
}
}
But, there is a problem, if one of the clients is block by some reason or slowed down by any reason,the client can not be synchronized. Monitior the animation state and sync it? but i can not find related filed or parameters in unity4' Mechanism, if using legacy animation system, can i synchronize ***AnimationState.time*** in ***Update*** function? If using Mechanism, how can i synchronize it?
Any answer will be appreciate,thanks in advance.
↧