Exemplo n.º 1
0
        void Update()
        {
            CheckConnection();

            if (NodeInformation.type.Equals("master"))
            {
                InputMessage inputMessage = new InputMessage();

                TimeSynchronizer.BuildMessage(inputMessage.inputTimeMessage);
                InputSynchronizer.BuildMessage(this, inputMessage.inputInputMessage);
                ParticleSynchronizer.BuildMessage(inputMessage.inputParticleMessage);
                AnimatorSynchronizer.BuildMessage(inputMessage.inputAnimatorMessage);
                TrackingSynchronizer.BuildMessage(inputMessage.inputTrackingMessage);
                TransformationSynchronizer.BuildMessage(inputMessage.inputTransformationMessage);
                EventSynchronizer.BuildMessage(inputMessage.inputEventsMessage);

                node.BroadcastMessage(inputMessage);
            }
            else
            {
                InputMessage inputMessage = new InputMessage();
                ((Client)node).WaitForNextMessage(inputMessage);

                TimeSynchronizer.ProcessMessage(inputMessage.inputTimeMessage);
                InputSynchronizer.ProcessMessage(this, inputMessage.inputInputMessage);
                ParticleSynchronizer.ProcessMessage(inputMessage.inputParticleMessage);
                AnimatorSynchronizer.ProcessMessage(inputMessage.inputAnimatorMessage);
                TrackingSynchronizer.ProcessMessage(inputMessage.inputTrackingMessage);
                TransformationSynchronizer.ProcessMessage(inputMessage.inputTransformationMessage);
                EventSynchronizer.ProcessMessage(inputMessage.inputEventsMessage);
            }

            StartCoroutine(EndOfFrame());
        }
Exemplo n.º 2
0
        private void LogCollider(EventType type, Collider other)
        {
            if (netId.IsEmpty())
            {
                if (GetComponent <NetworkIdentity>() != null)
                {
                    netId = GetComponent <NetworkIdentity>().netId;
                }
                else
                {
                    throw new MissingComponentException("CollisionSynchronization cannot be used without a NetworkIdentity component!");
                }
            }

            NetworkIdentity networkIdentity = other.gameObject.GetComponent <NetworkIdentity>();

            if (networkIdentity != null)
            {
                EventSynchronizer.LogEvent(type, netId, networkIdentity.netId.Value);
            }
        }
Exemplo n.º 3
0
 public static void OnClick(NetworkInstanceId netId)
 {
     EventSynchronizer.LogEvent(EventType.OnClick, netId, 0);
 }