From the course: Unity: Interactivity for AEC
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Script push buttons - Unity Tutorial
From the course: Unity: Interactivity for AEC
Script push buttons
- [Instructor] Now that we have our user interface built we can start to connect it into our scene using scripts. I'm going to start off with the button. So we're going to do something very simple. We're going to take this island in the scene and we're going to turn it off with this button, so if I select this you'll see we have a main node called island which contains everything else underneath it. So if we take this and we click off this little checkbox, it goes away. Now when I click this checkbox on or off I'm basically turning on or off whether or not the object is active. So let's go ahead and set this up. So the first thing I want to do is actually write a script. So I'm going to go into my scripts folder here, right click, do create and we're going to create a C sharp script. And I'm just going to call this button script, and I'm going to double click on this and it should open in MonoDevelop. Now in this script I basically just need to do one thing. I need to know when the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.