Displaying Upgrades
The problem I ran into this week was implementing the tower upgrade display on the placeable towers build overlay. The issue was that all the information I needed to display the upgrades was not made with the intention of using it outside of the upgrade shop. However, the upgrade shop fires a broadcast that an upgrade has been purchased.
Using this broadcast, I bound some events to listen when an upgrade had been purchased and hijacked the information I needed from that event.
From there I stored each upgrade as they are only fired once through the playthrough of the level.
Using the stored values, after cast checking the current targeted tower, I use the information to populate a upgrade display widget and place it in the upgrade section of the build overlay.
And the result is the build overlay showing the upgrade with the icon, name, and description.
Comments
Post a Comment