void HandCountStateChangeHandler(StateChange change) { if (change.unchanged) { if (change.state == JAX_NO_HANDS && Time.time - lastHandTime > MaxTimeWithoutHands && BoolValue == true) { Deactivate(); } else if (change.state == JAX_HANDS) { lastHandTime = Time.time; } return; } switch (change.state) { case JAX_HANDS: lastHandTime = Time.time; break; case JAX_NO_HANDS: // do nothing break; default: Debug.Log("Bad hand state"); break; } }
void HandleStateChangedEvent(StateChange change) { if ((!destroyed) && (change.state == FOUND_STATE_HAND_INVALID) && KillIfInvalid) { Destroy(gameObject, KILL_DELAY); destroyed = true; } }
void OnArmHUDStateChange(StateChange change) { if (change.unchanged || (!change.allowed)) { // Debug.Log ("ignoring change " + change.ToString ()); return; } //Debug.Log ("ArmHUDstate.Change: " + change.ToString ()); switch (change.toState.name) { case ARMHUDSTATE_NOLEFTHAND: RightAxisLookAt.IsFilterOn = false; CloseArmHUD(); Deactivate(); StopCoroutine("droppedLerp"); break; case ARMHUDSTATE_STATUS_ETC: // ChangeGraphicTo(StatusETC); CloseAllPanels(); PanelButtonsPanel.SetActive(false); RightAxisLookAt.IsFilterOn = false; StatusCanvas.SetActive(true); SettingsCanvas.SetActive(false); DropDelay = .5f; StopCoroutine("droppedLerp"); break; case ARMHUDSTATE_SETTINGS_ONLY: // ChangeGraphicTo(SettingsETC); PanelButtonsPanel.SetActive(true); RightAxisLookAt.IsFilterOn = true; StatusCanvas.SetActive(false); SettingsCanvas.SetActive(true); DropDelay = 1.0f; StopCoroutine("droppedLerp"); break; case ARMHUDSTATE_PANELVISIBLE: RightAxisLookAt.IsFilterOn = true; DropDelay = 3.0f; StopCoroutine("droppedLerp"); break; case ARMHUDSTATE_DROPPED: StartCoroutine(droppedCounter(DropDelay)); StartCoroutine("droppedLerp", DropDelay); break; } }
// responds to state change of Activeness; sets the alpha of ref objects. void ActivenessChanged(StateChange change) { if (change.unchanged) { return; } if (change.state == Activeness_Active) { //Reference.transform.rotation = Draggable.transform.rotation; //Debug.Log ("JoyBall's ActivenessChanged to: " + change.state); innerAlphan.SetAlpha(1.0f, .1f); outerAlphan.SetAlpha(1.0f, .1f); JoyballArrowsAlpha.SetAlpha(.5f, 0.25f); rotationRegisterded = false; StartCoroutine(UpdateReferenceRotation(0.5f)); Echo(JoystickEventType.Start, Vector3.zero, Quaternion.identity); //This my need to be an Object in Hand method GetComponent <ObjectInHand>().OnActivate(); // Allow player to look around without moving the reference GetComponent <AlignHalo>().enabled = false; } else { innerAlphan.SetAlpha(.1f, 0.25f); outerAlphan.SetAlpha(.1f, 0.25f); JoyballArrowsAlpha.SetAlpha(.1f, 0.25f); // ReferenceAlpha.SetAlpha (0, 0.1f); Echo(JoystickEventType.End, Vector3.zero, Quaternion.identity); //RefInitialized = false; //This may need to go in ObjectInHand GetComponent <ObjectInHand>().OnDeactivate(); // Align JoyBall with field of view GetComponent <AlignHalo>().enabled = true; } }
// responds to state change of Activeness; sets the alpha of ref objects. void ActivenessChanged(StateChange change) { if (change.unchanged) return; if (change.state == Activeness_Active) { //Reference.transform.rotation = Draggable.transform.rotation; //Debug.Log ("JoyBall's ActivenessChanged to: " + change.state); innerAlphan.SetAlpha (1.0f, .1f); outerAlphan.SetAlpha (1.0f, .1f); JoyballArrowsAlpha.SetAlpha(.5f, 0.25f); rotationRegisterded = false; StartCoroutine (UpdateReferenceRotation (0.5f)); Echo (JoystickEventType.Start, Vector3.zero, Quaternion.identity); //This my need to be an Object in Hand method GetComponent<ObjectInHand>().OnActivate(); // Allow player to look around without moving the reference GetComponent<AlignHalo>().enabled = false; } else { innerAlphan.SetAlpha (.1f, 0.25f); outerAlphan.SetAlpha (.1f, 0.25f); JoyballArrowsAlpha.SetAlpha(.1f, 0.25f); // ReferenceAlpha.SetAlpha (0, 0.1f); Echo (JoystickEventType.End, Vector3.zero, Quaternion.identity); //RefInitialized = false; //This may need to go in ObjectInHand GetComponent<ObjectInHand>().OnDeactivate(); // Align JoyBall with field of view GetComponent<AlignHalo>().enabled = true; } }
void OnArmHUDStateChange(StateChange change) { if (change.unchanged || (!change.allowed)) { // Debug.Log ("ignoring change " + change.ToString ()); return; } //Debug.Log ("ArmHUDstate.Change: " + change.ToString ()); switch (change.toState.name) { case ARMHUDSTATE_NOLEFTHAND: RightAxisLookAt.IsFilterOn = false; CloseArmHUD (); Deactivate(); StopCoroutine("droppedLerp"); break; case ARMHUDSTATE_STATUS_ETC: // ChangeGraphicTo(StatusETC); CloseAllPanels (); PanelButtonsPanel.SetActive(false); RightAxisLookAt.IsFilterOn = false; StatusCanvas.SetActive(true); SettingsCanvas.SetActive(false); DropDelay = .5f; StopCoroutine("droppedLerp"); break; case ARMHUDSTATE_SETTINGS_ONLY: // ChangeGraphicTo(SettingsETC); PanelButtonsPanel.SetActive(true); RightAxisLookAt.IsFilterOn = true; StatusCanvas.SetActive(false); SettingsCanvas.SetActive(true); DropDelay = 1.0f; StopCoroutine("droppedLerp"); break; case ARMHUDSTATE_PANELVISIBLE: RightAxisLookAt.IsFilterOn = true; DropDelay = 3.0f; StopCoroutine("droppedLerp"); break; case ARMHUDSTATE_DROPPED: StartCoroutine(droppedCounter(DropDelay)); StartCoroutine("droppedLerp", DropDelay); break; } }
void HandleHandContactStateChangedEvent(StateChange change) { cursorSet = false; FingerTipPositions.Clear(); }
void HandCountStateChangeHandler(StateChange change) { if (change.unchanged) { if ( change.state == JAX_NO_HANDS && Time.time - lastHandTime > MaxTimeWithoutHands && BoolValue == true) { Deactivate(); } else if ( change.state == JAX_HANDS ) { lastHandTime = Time.time; } return; } switch (change.state) { case JAX_HANDS: lastHandTime = Time.time; break; case JAX_NO_HANDS: // do nothing break; default: Debug.Log ("Bad hand state"); break; } }
void HandleStateChangedEvent(StateChange change) { if ((!destroyed) && (change.state == FOUND_STATE_HAND_INVALID) && KillIfInvalid) { Destroy (gameObject, KILL_DELAY); destroyed = true; } }
void HandleHandContactStateChangedEvent(StateChange change) { cursorSet = false; FingerTipPositions.Clear (); }
void GestureChanged(StateChange change) { if (change.unchanged) return; }