Skip to content

Instantly share code, notes, and snippets.

@AdamRamberg
Created October 20, 2019 21:16
Show Gist options
  • Save AdamRamberg/43a30c7b53f1ea99d25f85990d195427 to your computer and use it in GitHub Desktop.
Save AdamRamberg/43a30c7b53f1ea99d25f85990d195427 to your computer and use it in GitHub Desktop.
Announcing Unity Atoms version 2 - HealthBar.cs
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