Last active
April 28, 2020 08:50
-
-
Save Dssdiego/0d343cb0e3d5d0d5bf1418cf4d4d895f to your computer and use it in GitHub Desktop.
Unity Image Fill Setter
This file contains hidden or 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 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