Exemplo n.º 1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.CompareTag("Player") && canTakeDamage)
     {
         healthscript.GetDamage(damage, false, cooldown);
     }
 }
Exemplo n.º 2
0
 void OnParticleCollision(GameObject other)
 {
     Debug.Log("Bruh");
     if (healthscript.GetDamage(1, false, 1f))
     {
         Instantiate(blood, PlayerPosition.position, Quaternion.identity);
     }
 }
 public void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.CompareTag("Player"))
     {
         if (Item.Contain_Item("Key"))
         {
             Item.Remove_Item("Key");
             Destroy(gameObject);
         }
         else
         {
             HealthControl healthscript = GameObject.FindGameObjectWithTag("Player").GetComponent <HealthControl>();
             healthscript.GetDamage(healthscript.health, false, 1f);
         }
     }
 }