Beispiel #1
0
    public void HandleInput(Vector3 screenPosition)
    {
        if (jointTrans == null)
        {
            return;
        }
        var worldPos = Camera.allCameras[0].ScreenToWorldPoint(screenPosition);

        jointTrans.position = Player_CameraPlane.ScreenToWorldPlanePoint(Camera.allCameras[0], dragDepth, screenPosition);

        //If distance from player is too great
        //we need to break the join, and make sure all clients know we let it go
    }
Beispiel #2
0
    public void StartDragging(RaycastHit hit)
    {
        //If its a plugin
        if (pluginTask != null)
        {
            if (pluginTask.IsSlotted)
            {
                Debug.Log("Should be unslotted in 1 second.");
                pluginTask.UnSlot();
            }
        }

        //check to see if its a plugin/battery
        photonView.RPC("IsGrabbedRPC", RpcTarget.AllBufferedViaServer, true);

        //transform network ownership
        //this glitches when it collides with another owner
        photonView.TransferOwnership(PhotonNetwork.LocalPlayer);

        dragDepth  = Player_CameraPlane.CameraToPointDepth(Camera.allCameras[0], hit.point);
        jointTrans = AttachJoint(hit.rigidbody, hit.point);
    }