Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class EnemyTarget : MonoBehaviour, IDamageable
- {
- [SerializeField] private float health;
- public void Hit(float damageAmount)
- {
- health -= damageAmount;
- if (health <= 0)
- {
- Destroy(gameObject);
- }
- }
- public void Damage(float damageAmount)
- {
- Hit(damageAmount);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment