28 lines
685 B
C#
28 lines
685 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Animators.Leonid_Animator;
|
|
using UnityEngine;
|
|
using UnityEngine.InputSystem.XR.Haptics;
|
|
using UnityEngine.Networking;
|
|
using UnityEngine.UI;
|
|
public class HealthBarScript : MonoBehaviour
|
|
{
|
|
public Image HealthBar;
|
|
public float CurrentHealth;
|
|
public float MaxHealth = 100f;
|
|
public CharacterLocomotion Player;
|
|
|
|
private void Start()
|
|
{
|
|
//HealthBar = GetComponent<Image>();
|
|
//Player = FindObjectOfType<CharacterLocomotion>();
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
CurrentHealth = Player.health;
|
|
HealthBar.fillAmount = CurrentHealth / MaxHealth;
|
|
}
|
|
}
|