UnityEngine.Networking.NetworkTransformChild.HandleChildTransform C# (CSharp) Method

HandleChildTransform() static private method

static private HandleChildTransform ( NetworkMessage netMsg ) : void
netMsg NetworkMessage
return void
        internal static void HandleChildTransform(NetworkMessage netMsg)
        {
            NetworkInstanceId netId = netMsg.reader.ReadNetworkId();
            uint index = netMsg.reader.ReadPackedUInt32();
            NetworkDetailStats.IncrementStat(NetworkDetailStats.NetworkDirection.Incoming, 0x10, "16:LocalChildTransform", 1);
            GameObject obj2 = NetworkServer.FindLocalObject(netId);
            if (obj2 == null)
            {
                if (LogFilter.logError)
                {
                    Debug.LogError("HandleChildTransform no gameObject");
                }
            }
            else
            {
                NetworkTransformChild[] components = obj2.GetComponents<NetworkTransformChild>();
                if ((components == null) || (components.Length == 0))
                {
                    if (LogFilter.logError)
                    {
                        Debug.LogError("HandleChildTransform no children");
                    }
                }
                else if (index >= components.Length)
                {
                    if (LogFilter.logError)
                    {
                        Debug.LogError("HandleChildTransform childIndex invalid");
                    }
                }
                else
                {
                    NetworkTransformChild child = components[index];
                    if (child == null)
                    {
                        if (LogFilter.logError)
                        {
                            Debug.LogError("HandleChildTransform null target");
                        }
                    }
                    else if (!child.localPlayerAuthority)
                    {
                        if (LogFilter.logError)
                        {
                            Debug.LogError("HandleChildTransform no localPlayerAuthority");
                        }
                    }
                    else if (!netMsg.conn.clientOwnedObjects.Contains(netId))
                    {
                        if (LogFilter.logWarn)
                        {
                            Debug.LogWarning("NetworkTransformChild netId:" + netId + " is not for a valid player");
                        }
                    }
                    else
                    {
                        child.UnserializeModeTransform(netMsg.reader, false);
                        child.m_LastClientSyncTime = Time.time;
                        if (!child.isClient)
                        {
                            child.m_Target.localPosition = child.m_TargetSyncPosition;
                            child.m_Target.localRotation = child.m_TargetSyncRotation3D;
                        }
                    }
                }
            }
        }