- Defining classes and variables
- Attaching scripts to objects
- Understanding MonoBehaviour class
- Using the Unity Scripting API
- Importing assets
- Using a singleton pattern to manage game state
- Creating an event
Skill Level Intermediate
- Hi, I'm Kelley Hecker, and welcome to Scripting Unity with C#. Unity has many built in systems that allow you to create and customize your game. However, scripting is Unity's most powerful tool, giving you the ability to customize objects and control how they behave in the game. In this course, I'll show you how to create and attach C# scripts to game objects in Unity and introduce you to the development environment, MonoDevelop. Most of the scripts that you write in Unity will be extensions of the MonoBehaviour class, so we'll take an in-depth look at how the MonoBehaviour class functions.
We'll also look at some of the other built-in Unity classes you'll likely use while creating games. Finally, I'll cover the singleton pattern and events, which are two techniques that are especially useful for managing your game state, and allowing game objects to communicate with each other. So, if you're ready, let's get rolling!
Q: Why am I getting a script compile error when trying to load the exercise files?
A: This course was recorded in Unity 4.6, and Unity has since released Unity 5. There are two items to address for Unity 5 users.
Q: Why can't I see the Render Settings option in the Edit menu?
A: The Render Settings options have been moved in Unity 5. You can access them by going to the Window menu and choosing Lighting. In the window that loads, Render Settings can be found under the Scene tab.