Game Development Reference
In-Depth Information
Listing 37: A simple script to flip switch object
The function Flip() is executed when the message Flip is received. Now we have the trigger
that is capable of sending messages and usable objects that can receive messages. We need
to attach SwitcahbleTrigger script to the switch object and set the appropriate number of
states and messages per state. Illustration 41 shows this script in the inspector after pre-
paring it for use.
Search WWH ::




Custom Search