kadyr

Untitled

Aug 29th, 2021
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5.  
  6. public class Enemy : MonoBehaviour
  7. {
  8.  
  9. protected int health;
  10. protected GameObject player;
  11. protected int damage;
  12. private bool isDead;
  13. public void ChangeHealth(int hp)
  14. {
  15. health += hp;
  16. }
  17.  
  18. public virtual void Move()
  19. {
  20.  
  21. }
  22.  
  23. public virtual void Attack()
  24. {
  25.  
  26. }
  27.  
  28. private void Death()
  29. {
  30. isDead = true;
  31. GetComponent<Animator>().SetBool("death",isDead);
  32. GetComponent<Enemy>().enabled = false;
  33. }
  34. private void Start()
  35. {
  36. player = FindObjectOfType<PlayerController>().gameObject;
  37. }
  38.  
  39. void Update()
  40. {
  41.  
  42. }
  43. }
  44.  
Advertisement
Add Comment
Please, Sign In to add comment