mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-24 00:58:59 -05:00
17 lines
361 B
C#
17 lines
361 B
C#
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;
|
|
}
|
|
}
|
|
}
|
|
} |