19 lines
359 B
C#
19 lines
359 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class enemyHealthBar : MonoBehaviour
|
|
{
|
|
public enemyScript enemy;
|
|
|
|
|
|
float timer=0;
|
|
void Update()
|
|
{
|
|
if(timer >=0){ timer -= Time.deltaTime; return;}
|
|
|
|
timer = 0.5f;
|
|
enemy.healthBar.SetHealth(enemy.health, enemy.maxHealth);
|
|
}
|
|
}
|