Пример #1
0
        /// <summary>
        /// Called when an AnimatorUpdateMessage is received.
        /// </summary>
        /// <param name="msg"></param>
        /// <param name="receivedOnClient"></param>
        private void AnimatorUpdateMessageReceived(AnimatorUpdateMessage msg, bool receivedOnClient)
        {
            //Have to check sequence id against the FNT sending.
            int count = msg.Data.Count;

            for (int i = 0; i < count; i++)
            {
                /* Initially I tried caching the getcomponent calls but the performance difference
                 * couldn't be registered. At this time it's not worth creating the extra complexity
                 * for what might be a 1% fps difference. */
                if (NetworkIdentity.spawned.TryGetValue(msg.Data[i].NetworkIdentity, out NetworkIdentity ni))
                {
                    if (ni != null)
                    {
                        FlexNetworkAnimator fna = ReturnFNAOnNetworkIdentity(ni, msg.Data[i].ComponentIndex);
                        if (fna != null)
                        {
                            if (receivedOnClient)
                            {
                                fna.ServerDataReceived(msg.Data[i]);
                            }
                            else
                            {
                                fna.ClientDataReceived(msg.Data[i]);
                            }
                        }
                    }
                }
            }
        }
Пример #2
0
 /// <summary>
 /// Removes from ActiveFlexNetworkTransforms.
 /// </summary>
 /// <param name="fntBase"></param>
 public static void RemoveFromActive(FlexNetworkAnimator fntBase)
 {
     _activeFlexNetworkAnimators.Remove(fntBase);
 }
Пример #3
0
 /// <summary>
 /// Adds to ActiveFlexNetworkTransforms.
 /// </summary>
 /// <param name="fntBase"></param>
 public static void AddToActive(FlexNetworkAnimator fna)
 {
     _activeFlexNetworkAnimators.Add(fna);
 }