/// <summary> Link relevant scripts to this trackedHand, if they have not been assinged yet. </summary> protected void CheckForScripts() { if (this.hardware == null) { this.hardware = this.gameObject.GetComponent <SG_SenseGloveHardware>(); } if (this.handModel == null) { this.handModel = this.GetComponentInChildren <SG_HandModelInfo>(); } if (this.grabScript == null) { this.grabScript = this.GetComponentInChildren <SG_GrabScript>(); } if (this.feedbackScript == null) { this.feedbackScript = this.GetComponentInChildren <SG_HandFeedback>(); } if (this.handAnimation == null) { this.handAnimation = this.GetComponentInChildren <SG_HandAnimator>(); } //Since both RB and PhysicsTrackingLayers have the same component, assing whichever one we haven't done yet. if (this.rigidBodyLayer == null || this.physicsTrackingLayer == null) { SG_HandRigidBodies[] components = this.GetComponentsInChildren <SG_HandRigidBodies>(); for (int i = 0; i < components.Length; i++) { if (this.rigidBodyLayer == null && //we don't yet have a RigidBody Layer (this.physicsTrackingLayer == null || !GameObject.ReferenceEquals(this.physicsTrackingLayer.gameObject, components[i].gameObject))) { rigidBodyLayer = components[i]; } if (this.physicsTrackingLayer == null && //we don't yet have a RigidBody Layer (this.rigidBodyLayer == null || !GameObject.ReferenceEquals(this.rigidBodyLayer.gameObject, components[i].gameObject))) { physicsTrackingLayer = components[i]; } } } }
public void CalibrateWrist() { SG_HandAnimator handAnimation = this.senseGlove.GetComponent<SG_HandAnimator>(); if (handAnimation != null) { handAnimation.CalibrateWrist(); } }