Exemplo 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;
            }
        }
Exemplo n.º 2
0
 protected override void OnGrab()
 {
     base.OnGrab();
     if (MyNetworkManager.IsMyID(m_GrabData.GrabberID))
     {
         Vector3 handWorldPosition = VRInputManager.GetControllerPosition(m_GrabData.HandType, VRInputManager.PositionType.CONTROLLER);
         m_vPrevPullingPosition    = /*m_vCurrentPullingPosition =*/ handWorldPosition;
         prevPullingTargetPosition = m_tmPullingTarget.position;
         MyNetworkManager.SendToServer_FloatValue(MyNetworkManager.NET_GAME_MESSAGE.MSG_SYNC_PULL_VALUE, UID, m_fPulledValue);
         m_comunicationData.Send();
     }
 }
Exemplo n.º 3
0
 public void SetGrabData(uint _id, VRHand.eHandType _handType, Vector3 _position, Quaternion _rotation, float _receiveTime)
 {
     RecordData();
     grabbedCount++;
     SetDefaultData(_id, _handType, _position, _rotation, _receiveTime);
     if (MyNetworkManager.IsMyID(GrabberID))
     {
         GrabHandTransform = VRHandEventHandler.GetHandGrabPivot(HandType);
     }
     else
     {
         GrabHandTransform = NetCharacterHandler.GetHandGrabPivot(GrabberID, HandType);
     }
 }
Exemplo n.º 4
0
    protected override void OnGrab()
    {
        EventPullDeskDrawerHandler.RemoveObjectInsideDrawer(this);
        StopCheckGround();
        PlayGrabVoice();

        if (MyNetworkManager.IsMyID(m_GrabData.GrabberID))
        {
            SetTextureMultiply(m_fEmissionMultiplyWhenGrab);
        }
        else
        {
            SetTextureMultiply(0);
        }

        Pivot.parent = m_refTmRoot;
        SetRigidbodyValue(false, false);
    }