I have some code that makes a verticalProgress bar appear in the same place as the health bar. I'd like to make it appear behind the health bar, but the health bar is verticalprogress : BaseScreenComponent : IDisposable, and is not inheriting from MonoBehavior, so It doesn't have an OnGUI method, so it can't benefit from GUI.depth like MonoBehavior objects can. Is there a way around this?
I want to see if I can program a damage indicator behind the health bar (non-directional, just an amount). So you lose health, the health bar goes down, and you see a red color bar where the health bar was, and then the red space shrinks to match the size of the health bar after a split second. Some games do something like this nowadays.
Make a vitals bar appear behind existing bars?
- MeteoricDragon
- Posts: 141
- Joined: Mon Feb 12, 2018 8:23 pm
- MeteoricDragon
- Posts: 141
- Joined: Mon Feb 12, 2018 8:23 pm
Re: Make a vitals bar appear behind existing bars?
It looks like if i add the component to the parent in a different order, the red bar appears behind the health bar.MeteoricDragon wrote: ↑Mon Jul 16, 2018 3:01 am I have some code that makes a verticalProgress bar appear in the same place as the health bar. I'd like to make it appear behind the health bar, but the health bar is verticalprogress : BaseScreenComponent : IDisposable, and is not inheriting from MonoBehavior, so It doesn't have an OnGUI method, so it can't benefit from GUI.depth like MonoBehavior objects can. Is there a way around this?
I want to see if I can program a damage indicator behind the health bar (non-directional, just an amount). So you lose health, the health bar goes down, and you see a red color bar where the health bar was, and then the red space shrinks to match the size of the health bar after a split second. Some games do something like this nowadays.
- Interkarma
- Posts: 7249
- Joined: Sun Mar 22, 2015 1:51 am
Re: Make a vitals bar appear behind existing bars?
Glad you found the solution. I see what you're getting at, and will test code in a branch shortly.