Beispiel #1
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     Debug.Log("LOL");
     if (other.transform.CompareTag("Player"))
     {
         //assuming there is only one player:
         player.AdjustHealth(-3);
     }
 }
Beispiel #2
0
    public void Consume(GameObject player)
    {
        HealthManagement hm = player.GetComponentInChildren <HealthManagement>();

        hm.AdjustHealth(potency);
    }