private void ThrowPickedObject(Vector3 force) { _pickedObject.Throw(force); _animator.SetThrow(); _animator.SetCarriesObject(false); _pickedObject = null; }
private void HandleObjectPickable(PickUpable pickable) { if (_humanoid.pickedObject) { return; } onObjectPickable.Invoke(pickable); }
private void RemovePickable(PickUpable pickable) { if (!pickable) { return; } if (!pickUpablesInZone.Contains(pickable)) { return; } pickable.onPickedUp.RemoveListener(RemovePickable); pickUpablesInZone.Remove(pickable); onPickableExitArea.Invoke(pickable); }
public void Reinitialize() { dead = false; movementInput = Vector3.zero; _rigidbody.velocity = Vector3.zero; _rigidbody.angularVelocity = Vector3.zero; if (_pickedObject) { _pickedObject.Throw(Vector3.zero); } _pickedObject = null; _animator.SetInTheAir(false); _animator.SetRunning(false); _animator.SetCarriesObject(false); _pickablesArea.Reinitialize(); }
public bool PickUpOrDrop() { if (_pickedObject) { ThrowPickedObject(Vector3.zero); return(true); } if (!pickablesArea.anyPickable) { return(false); } _animator.SetPickUp(); _pickedObject = pickablesArea.any; _pickedObject.Pickup(_pickUpAnchor); _animator.SetCarriesObject(true); return(true); }
private void HandleObjectNotPickable(PickUpable _) { if (_humanoid.pickedObject) { return; } var pickableObject = pickablesArea.any; if (pickableObject) { onObjectPickable.Invoke(pickableObject); } else { onNoObjectPickable.Invoke(); } }