Difference between variables and properties

example of variable:

example of property:

Reason for using the property: 1. use for access date outside the class 2. can set read only or write only 3. can implement functions within set and get

Activate a sound effect

This script will activate the beep sound when the MRT card in the trigger range.

Ensure a character not stay without moving within specific area for more than 5 seconds

This code is to ensure test two conditions: 1. User must be within the trigger region 2. User must not be stationary for 5 seconds (user must move)

leap motion Basic Setup 1

Using this setup to learn the hand rotation values. Using the first detected hand values to find out Pitch, Yaw and Roll of a hand. Remember to place this to the top of the class definition:

then place the rest of the code in the update() function:

LeapMotion Trigger Setup

Using Leapmotion to touch and trigger GameObjects in the scene. This script first creating the leapmotion colliders and upon trigger activation, The GameObject will change color.

Unity control

Have unity to respond to in put Can place the following codes to the update function Keyboard

GetAxis