Exemple #1
0
 private void ThrowPickedObject(Vector3 force)
 {
     _pickedObject.Throw(force);
     _animator.SetThrow();
     _animator.SetCarriesObject(false);
     _pickedObject = null;
 }
Exemple #2
0
 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);
 }
Exemple #4
0
 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();
 }
Exemple #5
0
 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);
 }
Exemple #6
0
        private void HandleObjectNotPickable(PickUpable _)
        {
            if (_humanoid.pickedObject)
            {
                return;
            }
            var pickableObject = pickablesArea.any;

            if (pickableObject)
            {
                onObjectPickable.Invoke(pickableObject);
            }
            else
            {
                onNoObjectPickable.Invoke();
            }
        }