示例#1
0
        void FixedUpdate()
        {
            if (!_dragging)
            {
                return;
            }
            UICenterTarget.SetText("Dragging");
            //      Vector3 point = new Vector3(PlayerInput.LookInput.x, PlayerInput.LookInput.y, _screenPoint.z);
            //Vector3 dest = Player.Camera.ScreenToWorldPoint(point) + _offset;
            //_rigidbody.AddForce((dest - _rigidbody.position) * _pushForce);
            var ray = PlayerInputSystem.GetLookTargetRay;

            _rigidbody.MovePosition(ray.GetPoint(_hitDistance));
        }
示例#2
0
 private void SetNewCurrent(IWorldControl newCurrent, GameObject newGo)
 {
     _foundControl         = true;
     _clearTimer.Triggered = false;
     if (_current == newCurrent)
     {
         return;
     }
     if (_current != null)
     {
         UICenterTarget.Clear();
         _current.OnControlHovered(false);
     }
     _currentGameObject = newGo;
     _current           = newCurrent;
     UICenterTarget.SetText(_current.OnControlHovered(true));
 }