public void onRightHandPositionDetected(object sender, RightHandPositionDetectedEventArgs e) { switch(e.pos){ case RightHandPosition.UP: color_buttonBack = Color.green; Application.LoadLevel("Menu"); //Debug.Log("UP detected"); break; case RightHandPosition.MID: //Debug.Log("MID detected"); break; case RightHandPosition.DOWN: //Debug.Log("DOWN detected"); break; default: break; } }
void onRightHandPositionDetected (object sender, RightHandPositionDetectedEventArgs e){ switch(e.pos){ case RightHandPosition.UP: color_buttonHeadTracking = Color.green; Application.LoadLevel("HeadTracking"); //Debug.Log("UP detected"); break; case RightHandPosition.MID: color_buttonStartGame = Color.green; Application.LoadLevel("Game"); //Debug.Log("MID detected"); break; case RightHandPosition.DOWN: color_quitGame = Color.green; Application.Quit(); //Debug.Log("DOWN detected"); break; default: break; } }
public void onRightHandPositionDetected(object sender, RightHandPositionDetectedEventArgs e) { if (i_healthPoints > 0) return; if (e.pos == RightHandPosition.UP) { him.rightHandPositionDetected -= new RightHandPositionDetectedEventHandler(onRightHandPositionDetected); Application.LoadLevel("Menu"); } else if(e.pos == RightHandPosition.DOWN){ // restart game go_gameover.SetActive(false); i_healthPoints = i_maxHealthPoints; i_score = 0; } }
// trigger the event handlers protected virtual void OnRightHandPositionDetected(RightHandPosition pos) { if (rightHandPositionDetected != null) { RightHandPositionDetectedEventArgs e = new RightHandPositionDetectedEventArgs(); e.pos = pos; rightHandPositionDetected (this, e); } }