mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-26 18:08:27 -05:00
e5f6659eda
* Removed unused namespaces across all files in Unity.Atoms assembly. * Removed unused namspaces in runtime and Test assembly code.
21 lines
545 B
C#
21 lines
545 B
C#
using UnityEngine;
|
|
using UnityAtoms.Extensions;
|
|
|
|
namespace UnityAtoms.Examples
|
|
{
|
|
[CreateAssetMenu(menuName = "Unity Atoms/Examples/Intro/Decrease Players Health")]
|
|
public class DecreasePlayersHealth : Collider2DAction
|
|
{
|
|
[SerializeField]
|
|
private StringConstant TagPlayer = null;
|
|
|
|
public override void Do(Collider2D collider)
|
|
{
|
|
if (collider.gameObject.HasTag(TagPlayer))
|
|
{
|
|
collider.GetComponent<PlayerHealth>().Health.Value -= 10;
|
|
}
|
|
}
|
|
}
|
|
}
|