Game Development Reference
In-Depth Information
You don't have to build an input system if you don't want to; this is just one
example. If you wish you can simply call
ExecuteEvents.Execute
(provided you
have a reference to the
Event System
from the scene) from anywhere in your code to
fire an event, say for a Game Over event maybe!
The Roll a Ball Derby
If we take the previous system and put it into action in a simple example, we can
start to see the possibilities of the new UnityEvent system.
For this, I used Unity's own
Roll a Ball
example from their tutorial
site, which you can follow along to create the base sample:
http://
To save time (and since Unity doesn't provide a finished version of the
tutorial) I've created a Unity package you can import to speed along its
then import into your project using
Assets
|
Import Package
|
Custom
Package
in the menu. (It's also included in the code bundle for this project
in the
Chapter 6
folder).
In the
Roll A Ball
example, we start off with a simple scene where our valiant hero
ball is completely surrounded, as you can see in the following screenshot:
The completed Roll A Ball Unity tutorial (without the GUIText parts)