Esempio n. 1
0
    private void OnCollisionEnter(Collision collision)
    {
        HP heelabe = collision.transform.GetComponent <HP>();

        if (heelabe != null)
        {
            HP.heel = heeling;
            heelabe.Heel();
        }
        Destroy(gameObject);
    }
Esempio n. 2
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.CompareTag("Player"))
     {
         HP playerHP = other.GetComponent <HP>();
         if (playerHP?.GetHP() == 100f)
         {
             return;
         }
         playerHP.Heel(_heel);
         Debug.Log("Play audio");
         _audio.Play();
         gameObject.SetActive(false);
     }
 }