Unity UI Question #4330
-
I created a boss zombie's health bar (at the top of the game) in Unity UI, but it doesn't work. I know that in order for the health bar to naturally shrink, the fill value of the image needs to be reduced, but looking at related posts, it doesn't seem like this type of UI works. And I learned from the previous Q&A that when creating a custom script in Unity, you have to use a function that exists inside the game. For example below. Code in https://github.com/Unturned-Datamining/Unturned-Datamining
acid.cs code from olie's repository
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Yes, you can't add any code to the game through mods unless you do it purely through unity's UI (using mod hooks and events). The way most people do bars like that is by using the unicode block character in a text component. Another couple of options:
|
Beta Was this translation helpful? Give feedback.
ModHooks are a select number of classes Nelson exports for use, but you can technically export any and use them, just most won't be useful or won't work properly.