internal void TryDrop() { if (_carryInfo != default) { _carryInfo.Grabbable.HandleDrop(); _carryInfo = default; } }
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()); } }
internal void TryInsert() { if (_carryInfo == null) { return; } InsertableInfo insertInfo = _carryInfo.InsertInfo; if (insertInfo != null && insertInfo.Insertable.TryInsertIn(insertInfo.InsertFriendly)) { _carryInfo = null; } }