Files
real-shooter/Assets/Scripts/Weapons/Target.cs
2022-04-18 16:00:39 +07:00

24 lines
358 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Target : MonoBehaviour
{
public float health = 50f;
public void TakeDamage(float amount)
{
health -= amount;
if (health <= 0f)
{
Die();
}
}
void Die()
{
Destroy(gameObject);
}
}