コード例 #1
0
    /// <summary>
    /// Checks the item type, and does action according to it.
    /// </summary>
    /// <param name="dir"></param>
    protected virtual void useItem()
    {
        if (isGrounded)
        {
            rbd.velocity = new Vector2(0, 0);
        }

        if (grabbedItem is ThrowableItem)
        {
            state = Utilities.state.Throwing;
            anim.Play("Throw");
            anim.SetBool("holdAnimation", true);
        }
        if (grabbedItem is OnUseItem)
        {
            grabbedItem.setIsUsed(true);
            grabbedItem.setIsPicked(false);
            grabbedItem.itemAction(this);
        }
    }