Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class Player : MonoBehaviour, ICollision, IHealth
- {
- public float Health;
- public void TakeDamage()
- {
- Health -= 1;
- if (Health <= 0)
- {
- Die();
- }
- }
- public void Die()
- {
- Destroy(gameObject);
- }
- public void Collided()
- {
- TakeDamage();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement