コード例 #1
0
    private void Update()
    {
        if (itemInCollider == null || Input.GetMouseButtonUp(0) == false)
        {
            return;
        }

        if (itemInCollider == itemToCombineWith && minRequiredCount <= itemToCombineWith.counter)
        {
            onCombine.Invoke();
            GlobalOnCombine.Invoke();
            GameHandler.soundHandler.combine.Play();

            if (deleteItem)
            {
                GameHandler.inventory.Remove(itemToCombineWith);
                if (description != null)
                {
                    description.ClearDescription();
                }
            }
            if (deactivateObject)
            {
                gameObject.SetActive(false);
            }
        }
        else
        {
            GameHandler.soundHandler.combineError.Play();
        }

        itemInCollider = null;
    }