示例#1
0
    public void FixedUpdate()
    {
        _selected = SelectNearbySlide();

        _slideGhost.SetActive(_selected != null && currentSlide == null);

        if (currentSlide == null && _selected != null)
        {
            if (_selected.ConnectedHand)
            {
                return;
            }
            currentSlide = _selected;
            currentSlide.Transform.position = _slideGhost.transform.position;
            currentSlide.Transform.rotation = _slideGhost.transform.rotation;
            var joint = currentSlide.CreateGrabJoint();
            joint.connectedBody   = _rigidbody;
            joint.enableCollision = false;
            joint.breakForce      = 1000.0f;
            //currentSlide.Rigidbody.useGravity = false;
            currentSlide.slideProjector = this;
        }

        if (_nextSlideLever.Value > _nextSlideLever.actuationPoint)
        {
            NextSlide();
        }
    }