//--------------------------------------------------------------------------------------------------------------------------------- // Touch Methods /// <summary> Get the index </summary> /// <param name="grabScript"></param> /// <returns></returns> protected int GetTouchIndex(SG_HapticGlove grabScript) { //for (int i = 0; i < this.touchedScripts.Count; i++) //{ // if (GameObject.ReferenceEquals(this.touchedScripts[i].gameObject, grabScript.gameObject)) // return i; //} return(-1); }
/// <summary> Get a list of all Haptic Glove Hardware within this detection area. </summary> /// <returns></returns> public SG_HapticGlove[] GlovesInside() { SG_HapticGlove[] res = new SG_HapticGlove[this.detectedHands.Count]; for (int i = 0; i < this.detectedHands.Count; i++) { res[i] = this.detectedHands[i].Glove; } return(res); }
/// <summary> Checks for scripts that might be connected to this GameObject. Used in editor and during startup. </summary> public override void CheckForScripts() { base.CheckForScripts(); if (this.gloveHardware == null) { this.gloveHardware = this.Hardware; } SG_Util.CheckForHandInfo(this.transform, ref this.handModel); }
//------------------------------------------------------------------------------------------------------------------------------------------- // Functions /// <summary> Setup the SG_BasicFeedback script components </summary> public virtual void SetupSelf() { //Debug.Log(this.name + "Calculated Offsets!"); SG_Util.TryAddRB(this.gameObject, false, true); cooldownTimer = 0; SetTrackingTarget(this.trackingTarget, true); //updates offsets on start this.lastPosition = this.transform.position; if (this.linkedGlove == null && this.feedbackScript != null && this.feedbackScript.TrackedHand != null) { this.linkedGlove = this.feedbackScript.TrackedHand.gloveHardware; } }