示例#1
0
 /// <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);
     }
 }
示例#2
0
 /// <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);
     }
 }
示例#3
0
        //--------------------------------------------------------------------------------------------------------------
        // 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);
            }
        }
示例#4
0
        /// <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);
            }
        }
示例#5
0
 private void CancelZone_Activated(object source, SG_HandDetector.GloveDetectionArgs args)
 {
     CancelCalibration();
 }
示例#6
0
 private void CalibrationZone_Reset(object source, SG_HandDetector.GloveDetectionArgs args)
 {
     UpdateInstructions();
 }
示例#7
0
 private void CalibrationZone_Activated(object source, SG_HandDetector.GloveDetectionArgs args)
 {
     NextCalibrationStep();
     UpdateInstructions();
 }
示例#8
0
 private void ResetSphere_Activated(object source, SG_HandDetector.GloveDetectionArgs args)
 {
     ResetCalibrationRange(args.trackedHand);
 }
示例#9
0
 /// <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);
 }
示例#10
0
        //--------------------------------------------------------------------------------------------------------------
        // 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);
        }