/// <summary> Fire the Activated Event, if we have subscribers available </summary> /// <param name="args"></param> private void OnZoneReset(SG_HandDetector.GloveDetectionArgs args) { if (Reset != null) { Reset(this, args); } }
/// <summary> Fire the Activated Event, if we have subscribers available </summary> /// <param name="args"></param> private void OnZoneActivated(SG_HandDetector.GloveDetectionArgs args) { if (Activated != null) { Activated(this, args); } }
//-------------------------------------------------------------------------------------------------------------- // Class Logic - Before Calling events /// <summary> Called when the sphere is touched for the first time. </summary> public void CheckSphereConfirm(SG_HandDetector.GloveDetectionArgs args) { if (enableAllowed && zoneEnabled) { enableAllowed = false; //we're no longer allowed to enable our glove. //Debug.Log(this.name + ": Activate!"); this.innerZone.SetHighLight(false); InstructionsEnabled = instructionsStayVisible; //fire the event OnZoneActivated(args); } }
/// <summary> Called when the hand exits the outerZone. </summary> public void CheckSphereReset(SG_HandDetector.GloveDetectionArgs args) { if (!enableAllowed) { enableAllowed = true; //Debug.Log(this.name + ": Reset!"); //Only turn these back on if the zone is enabled. this.innerZone.SetHighLight(zoneEnabled); InstructionsEnabled = zoneEnabled; //fire the event OnZoneReset(args); } }
private void CancelZone_Activated(object source, SG_HandDetector.GloveDetectionArgs args) { CancelCalibration(); }
private void CalibrationZone_Reset(object source, SG_HandDetector.GloveDetectionArgs args) { UpdateInstructions(); }
private void CalibrationZone_Activated(object source, SG_HandDetector.GloveDetectionArgs args) { NextCalibrationStep(); UpdateInstructions(); }
private void ResetSphere_Activated(object source, SG_HandDetector.GloveDetectionArgs args) { ResetCalibrationRange(args.trackedHand); }
/// <summary> Fired when the user removes the hand from the outermost zone. Allows us to use the sphere again </summary> /// <param name="source"></param> /// <param name="args"></param> private void OuterZone_GloveRemoved(object source, SG_HandDetector.GloveDetectionArgs args) { CheckSphereReset(args); }
//-------------------------------------------------------------------------------------------------------------- // Event Handlers - What this script is subscribed to. /// <summary> Fired when entering the innermost zone. </summary> /// <param name="source"></param> /// <param name="args"></param> private void InnerZone_GloveDetected(object source, SG_HandDetector.GloveDetectionArgs args) { CheckSphereConfirm(args); }