Example #1
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.name == "Player")
        {
            if (!isUsed)
            {
                playerController.IncHP(1, 1);

                if (hunger != null)
                {
                    hunger.EatBerry();
                }
            }

            if (OneUse)
            {
                isUsed = true;

                if (DestoryOnUse)
                {
                    Destroy(gameObject);
                }
            }
        }
    }