예제 #1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "Player")
        {
            healthScript = other.gameObject.GetComponent <Player_Health>();

            if (healthScript.CurrHp < healthScript.MaxHp)
            {
                source.Play();
                healthScript.HpPowerUpCollected();
                Destroy(gameObject);
            }
        }
    }