Easily Manage the State of Your UI With This Pattern to Save Yourself Headaches
Published: 23 Nov 2021
On your UI do you have references from random scripts to other scripts to manage which one should be showing? Are you setting up the state of the next page in code where your UI scripts are tightly coupled?
In this video I'll show you the pattern I've been using for the last 6 years to remove that mess and separate the concerns of UI Sounds and Animations into a "Page" Monobehaviour that is controlled by the MenuController. With these two simple, but powerful scripts you can easily manage your UI page state in a simple, predictable, and powerful way.
At the end of this video you'll have:
A structured, proven paradigm to approach to managing pages on your UI
An easy way to decouple your animation and sound playing from your UI logic.
A tool to intelligently control what needs to be set up, when it needs to be set up, instead of having that hard coded in your scripts.
๐จโ๐ป As always, all code from this video is available on GitHub: https://github.com/llamacademy/menu-controller
๐ท๏ธSave 25% on the ultimate C# IDE: JetBrains Rider with code LLAMACADEMY: https://www.jetbrains.com/store/?section=personal&billing=yearly