In this video we'll be changing the current single health bar class into one that handles multiple energy bars and also changing Mega Man's color scheme for the weapon he acquires from defeating a boss. For the enemy bars we'll use a basic approach of a colored sprite for each bar color. Mega Man however will use a different approach via a shader. If you've followed along with the series then you know that when we had enemies in multiple colors we used animator controller overrides and duplicated the animations for each color. This method is hardly scalable and for each enemy Mega Man defeats, he'll acquire a new color scheme, plus add to the fact we haven't finished all his animations so we'd have to keep updating him. Nah, that's okay. Instead with the shader approach all we have to do is add the color swap in code and instant new colored outfit.
P.S. I realized after everything was said and done that I completely forgot about the Magnet Beam option! DOH! So in the next video that continues this enhancement I'll add in the code for the Magnet Beam.
Source code for this project can be found on my GitHub: https://github.com/tonybhimani/unity-...
and you can see my other videos for the main project here: • Unity Mega Man Development
Enjoy!
EDIT: follow-up video to address the shader transparency and missing MagnetBeam code. • Unity Mega Man Dev - ColorSwap Transparenc...
Direct comments, suggestions, and questions to my new Discord server.
/ discord