コード例 #1
0
        public void ReceiveTime(MyNetworkManager.NetMessage _msg)
        {
            m_iClientTime = 0;
            _msg.ResetPosition();
            _msg.Sub(out m_iClientTime);
            m_iMinutes = Mathf.FloorToInt(m_iClientTime / 60f);
            m_iSeconds = Mathf.FloorToInt(m_iClientTime - m_iMinutes * 60);

            if (onTimerUpdate != null)
            {
                onTimerUpdate(m_iClientTime);
            }

            if (m_iClientTime == 0)
            {
                m_bIsTimeover = true;
                GameState.Instance.ChangeGameState(eGameState.Finish);
            }
        }
コード例 #2
0
        private void MyNetworkManager_OnReceiveNetMessageClient(MyNetworkManager.NetMessage obj)
        {
            if (obj.ReceiverID != UID)
            {
                return;
            }

            obj.ResetPosition();
            switch (obj.MsgType)
            {
            case MyNetworkManager.NET_GAME_MESSAGE.MSG_GRAB:
                ReceiveGrab(obj);
                break;

            case MyNetworkManager.NET_GAME_MESSAGE.MSG_UNGRAB:
                ReceiveUnGrab(obj);
                break;
            }
        }