Created
October 20, 2019 21:16
-
-
Save AdamRamberg/43a30c7b53f1ea99d25f85990d195427 to your computer and use it in GitHub Desktop.
Announcing Unity Atoms version 2 - HealthBar.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HealthBar : MonoBehaviour | |
{ | |
[SerializeField] | |
private IntVariable Health; | |
void Update() | |
{ | |
GetComponent<Image>().fillAmount = 1.0f * Health.Value / Health.InitialValue; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment