Setting the Animator's Parameters with code

We have a script named ShowHidePanels.cs attached to the Main Camera that would bring the Pause Panel and Inventory Panel up when the P and I keys are pressed. Sadly, it no longer functions, since the animations now supersede the properties of the Canvas Groups we set within it. We can reuse the logic, but will have to do a bit of work to get out panels popping again.

The changes that we will make to ShowHidePanels.cs will cause the panels in preceding chapter scenes to stop appearing. If you plan on accessing the previous chapter scenes, save a secondary copy of this script as it is now so that you can access it later. 

To trigger the animations on the Pause Panel and Inventory Panel with code, ...

Get Mastering UI Development with Unity now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.