コード例 #1
0
        public void Deserialize(Buffer buffer)
        {
            int length = Buffer.Get <int>(buffer);

            for (int i = 0; i < length; i++)
            {
                StoredAnimator animator = new StoredAnimator();
                animator.networkId    = Buffer.Get <uint>(buffer);
                animator.animatorTime = Buffer.Get <float>(buffer);
                animators.Add(animator);
            }
        }
コード例 #2
0
 public static void BuildMessage(InputAnimatorMessage message)
 {
     foreach (KeyValuePair <NetworkInstanceId, NetworkIdentity> networkIdentity in NetworkServer.objects)
     {
         if (networkIdentity.Value.gameObject.GetComponent <Animator>() != null)
         {
             StoredAnimator animator = new StoredAnimator();
             animator.networkId    = networkIdentity.Key.Value;
             animator.animatorTime = networkIdentity.Value.gameObject.GetComponent <Animator>().GetCurrentAnimatorStateInfo(0).normalizedTime;
             message.animators.Add(animator);
         }
     }
 }