From the course: Unity: AR Visualization 02 Basic Interactivity

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Scripting the menu system

Scripting the menu system - Unity Tutorial

From the course: Unity: AR Visualization 02 Basic Interactivity

Start my 1-month free trial

Scripting the menu system

- [Instructor] Now that we have our main menu all set up it's time to jump into some code. Let's open the UIManager in your code editor, excellent. So we need a couple of things here, one we need a way to identify our menus and they that we're going to do that is using an enum. Let's go and make public enum and call it Menus. Here we're going to setup an index for every menu that we want to launch. The first one's going to be MainMenu. Second one is going to be settings. And the last one's going to be parts. Perfect, so now we have a way to identify the menus we need to make a menu collection. This is going to be a collection of the game objects that represent the menus themselves. So here we're going to setup a public GameObject array. And it's public because we want it exposed in the editor. And we're going to call this menus. Great, now let's setup some methods to hide and show our menus accordingly. The first method…

Contents