Skip to content

Instantly share code, notes, and snippets.

@Dssdiego
Last active April 28, 2020 08:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dssdiego/0d343cb0e3d5d0d5bf1418cf4d4d895f to your computer and use it in GitHub Desktop.
Save Dssdiego/0d343cb0e3d5d0d5bf1418cf4d4d895f to your computer and use it in GitHub Desktop.
Unity Image Fill Setter
public class ImageFillSetter : MonoBehaviour {
public FloatReference Variable;
public FloatReference Max;
public Image image;
private void Update() {
Image.fillAmount = Mathf.Clamp(Variable.Value / Max.Value);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment