17 lines
361 B
C#
Raw Normal View History

2018-11-12 22:15:14 +01:00
using UnityEngine;
using UnityEngine.UI;
using UnityAtoms;
namespace UnityAtoms.Examples
{
public class Harmful : MonoBehaviour
{
void OnTriggerEnter2D(Collider2D collider)
{
if (collider.tag == "Player")
{
collider.GetComponent<PlayerHealth>().Health.Value -= 10;
}
}
}
}