Пример #1
0
    public void ReleaseItem(bool enableThrow = true)
    {
        if (_itemBeingHeld != null) // e sempre deveria ser...
        {
            _itemBeingHeld.Release();

            //Throw
            if (Mathf.Abs(_playerRb.velocity.x) > MinSpeedToThrow && enableThrow == true)
            {
                _itemBeingHeld.GetRigidBody2d().velocity = new Vector2(1f * Mathf.Sign(_playerRb.velocity.x), 1f).normalized *ThrowForce;
            }

            _itemBeingHeld = null;
        }
    }