Thursday 4 May 2017

Outside the Box Project Beta Work - Not Enough Money Feedback

This used to work by having the No_Money_Panel's SetActive Boolean being set to False at all times and then would be set to True only when the conditions were met where the player didn't have enough money to purchase an upgrade or defence. The panel would then be moved to the Mouse Cursor position as it was at the time of meeting these prior conditions and a Coroutine would then activate, WaitingForSeconds to then set the Boolean back to False.

This was changed to what I am about to explain as to access required information from the panel with a script that was attached to the panel, said panel's SetActive Boolean needed to remain True at all times during the game. It is also more ideal from a mechanical and optimisation point of view to leave repeatedly accessed GameObjects on in the scene so as to improve script functionality for access to said GameObjects and to improve Frame Rate.


So now the feedback UI piece is sat outside of the view of the UI Canvas and when the conditions are met for the feedback to appear to the Player (not enough money to either upgrade or purchase a Defence) the UI piece is moved to the current position of the Mouse Cursor on the screen and the the public void Show() is run (as seen in Figure 2.) within the UpgradeComponent script (as seen in Figure 1.) as the UpgradeComponent keeps track of if the Player has enough funds to purchase/upgrade Defences.


Figure 1.

Figure 2.


No comments:

Post a Comment