Isolating code

I create live walkthroughs with unity, and all of my interaction is through a GUI. That menu file gets pretty large and complicated. And if I’m trying to do something new, and it doesn’t work, my whole menu fails. What can I do to make my code more modular? Thanks.

divide functionality into different scripts…?

There is no single answer to this question, but for starters: Usually, having a long file isn’t as bad as having a very long function. Perhaps you already do this, but i would start by breaking out some code into separate functions. I assume you have distinct parts of your GUI? You could start by breaking out some of your logic, perhaps creating functions like DrawMenu or DrawToolbar and calling those. This should make your code a lot easier to work with.