Added things
This commit is contained in:
27
Assets/Scripts/Character/HealthBarScript.cs
Normal file
27
Assets/Scripts/Character/HealthBarScript.cs
Normal file
@ -0,0 +1,27 @@
|
||||
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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user