예제 #1
0
        private static void ParseNetworkTransfrom(NetworkMessage msg)
        {
            NetworkMessage.UpdateTransformMessage transformMessage = (NetworkMessage.UpdateTransformMessage)msg;

            NetworkEntity entity = null;

            try {
                entity = objectRegistryCallback(transformMessage.objectId);
            }
            catch (EntityNotFoundException e) {
                Debug.LogWarning("Unable to update transform of network entity with id " + transformMessage.objectId.id);
                return;
            }
            finally {
                Debug.Log("In finally");
                NetworkTransform netTransform = entity.GetComponent <NetworkTransform>();

                if (netTransform != null)
                {
                    netTransform.ReceiveTransformUpdate(transformMessage.relayPosition.Value, transformMessage.relayRotation.Value, transformMessage.childRelayPosition.Value, transformMessage.childRelayRotation.Value, transformMessage.relayVelocity.Value);
                }
            }
        }