Esempio n. 1
0
        private void MyNetworkManager_OnReceiveNetMessageClient(MyNetworkManager.NetMessage obj)
        {
            if (!obj.IsSameReceiverID(UID))
            {
                return;
            }

            switch (obj.MsgType)
            {
            case MyNetworkManager.NET_GAME_MESSAGE.MSG_SYNC_PULL_VALUE:
                if (!MyNetworkManager.IsMyID(obj.SenderID))
                {
                    obj.Sub(out float newPullValue);
                    m_fPrevPulledvalue = m_fPulledValue;
                    m_fPulledValue     = newPullValue;
                    m_comunicationData.Receive();

                    if (!m_GrabData.IsGrabbing)
                    {
                        TranslatePullingTarget(m_fPulledValue);
                    }
                }
                break;
            }
        }
        private void MyNetworkManager_OnReceiveNetMessageClient(MyNetworkManager.NetMessage _netMessage)
        {
            if (!_netMessage.IsSameReceiverID(UID))
            {
                return;
            }

            switch (_netMessage.MsgType)
            {
            case MyNetworkManager.NET_GAME_MESSAGE.MSG_DESK_OPEN:
                if (m_refSoundSourceOpen != null)
                {
                    m_refSoundSourceOpen.Play(Pivot.position);
                }
                if (onStartOpen != null)
                {
                    onStartOpen.Invoke();
                }
                StartProcToMax(OpenDesk);

                break;

            case MyNetworkManager.NET_GAME_MESSAGE.MSG_DESK_CLOSE:
                if (m_refSoundSourceClose != null)
                {
                    m_refSoundSourceClose.Play(Pivot.position);
                }

                DisableIncludeObject();
                StartProcToMin(CloseDesk);
                break;
            }
        }
Esempio n. 3
0
 private void MyNetworkManager_OnReceiveNetMessageClient(MyNetworkManager.NetMessage obj)
 {
     switch (obj.MsgType)
     {
     case MyNetworkManager.NET_GAME_MESSAGE.MSG_PUSH_BUTTON:
         if (obj.IsSameReceiverID(UID))
         {
             ClickedPlayerID    = obj.SenderID;
             m_fLastClickedTime = obj.ServerTime;
             PushedButton();
         }
         break;
     }
 }
Esempio n. 4
0
    private void MyNetworkManager_OnReceiveNetMessageClient(MyNetworkManager.NetMessage obj)
    {
        if (!obj.IsSameReceiverID(UID))
        {
            return;
        }

        switch (obj.MsgType)
        {
        case MyNetworkManager.NET_GAME_MESSAGE.AWTG_INSTALL_PIECE_OF_MEMORY:
            obj.Sub(out uint pieceID);
            GameManagers.GameSound.Instance.Play(GameManagers.eSoundID_FX.c_3, transform.position);
            ReceiveInstallPiece(pieceID);
            break;
        }
    }