コード例 #1
0
 internal void TryDrop()
 {
     if (_carryInfo != default)
     {
         _carryInfo.Grabbable.HandleDrop();
         _carryInfo = default;
     }
 }
コード例 #2
0
 internal void TryGrab()
 {
     if (TryGetClosestHit(_lookRay, out RaycastHit hit) &&
         Vector3.Distance(hit.point, _player.position) < _maxInteractDistance &&
         hit.collider.TryGetComponent(out IGrabbable grabbed))
     {
         _carryInfo = new CarryInfo(grabbed);
         grabbed.HandleGrab();
         StartCoroutine(Carrying());
     }
 }
コード例 #3
0
        internal void TryInsert()
        {
            if (_carryInfo == null)
            {
                return;
            }
            InsertableInfo insertInfo = _carryInfo.InsertInfo;

            if (insertInfo != null && insertInfo.Insertable.TryInsertIn(insertInfo.InsertFriendly))
            {
                _carryInfo = null;
            }
        }