Esempio n. 1
0
        private void SendPosition()
        {
            var mInstance = MultiplayerManager.instance;

            var message = new MessageUpdatePlayerPosition();
            message.playerId = m_playerId;
            message.position = transform.position;
            message.rotation = transform.rotation.eulerAngles;

            mInstance.SendNetworkMessage(message, SendTo.Others, null, NetDeliveryMethod.Unreliable);
        }
Esempio n. 2
0
        private void SendPosition()
        {
            var mInstance = MultiplayerManager.instance;

            var message = new MessageUpdatePlayerPosition();

            message.playerId = m_playerId;
            message.position = transform.position;
            message.rotation = transform.rotation.eulerAngles;

            mInstance.SendNetworkMessage(message, SendTo.Others, null, NetDeliveryMethod.Unreliable);
        }
Esempio n. 3
0
        public override void OnCalled(Message msg, NetIncomingMessage netMsg = null)
        {
            MessageUpdatePlayerPosition message = msg as MessageUpdatePlayerPosition;
            var instance = MultiplayerManager.instance;

            var player = instance.m_players.FirstOrDefault(x => x.ID == message.playerId);

            if (player != null)
            {
                player.PlayerGameObject.GetComponent <PlayerNetworkView>().OnNetworkData(netMsg.ReceiveTime, message.position, Quaternion.Euler(message.rotation));
            }
        }