示例#1
0
        //----------------------------------------------------------------------------------------------
        // Monobehaviour

        protected override void Awake()
        {
            base.Awake();
            SG_Util.CheckForHandInfo(this.transform, ref this.handModel);
            if (this.handModel != null)
            {
                if (palmTouch != null && !palmTouch.HasTarget)
                {
                    this.palmTouch.SetTrackingTarget(handModel.wristTransform, true);
                }

                Transform target;
                if (thumbTouch != null && !thumbTouch.HasTarget && handModel.GetFingerTip(SG_HandSection.Thumb, out target))
                {
                    this.thumbTouch.SetTrackingTarget(target, true);
                }
                if (indexTouch != null && !indexTouch.HasTarget && handModel.GetFingerTip(SG_HandSection.Index, out target))
                {
                    this.indexTouch.SetTrackingTarget(target, true);
                }
                if (middleTouch != null && !middleTouch.HasTarget && handModel.GetFingerTip(SG_HandSection.Middle, out target))
                {
                    this.middleTouch.SetTrackingTarget(target, true);
                }
            }
        }
示例#2
0
 /// <summary> Assign scripts relevant to this script's functioning. </summary>
 protected virtual void CheckForScripts()
 {
     SG_Util.CheckForHandInfo(this.transform, ref this.handModel);
     if (this.Hand == null)
     {
         this.Hand = SG_Util.CheckForTrackedHand(this.transform);
     }
 }
示例#3
0
 /// <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);
 }
 /// <summary> Checks for scripts that might be connected to this GameObject. Used in editor and during startup. </summary>
 public virtual void CheckForScripts()
 {
     if (connectedGlove == null)
     {
         connectedGlove = this.gameObject.GetComponent <SG_SenseGloveHardware>();
         if (connectedGlove == null && this.transform.parent != null) //still nothing
         {
             connectedGlove = this.transform.parent.GetComponent <SG_SenseGloveHardware>();
         }
     }
     SG_Util.CheckForHandInfo(this.transform, ref this.handModel);
 }
示例#5
0
 /// <summary> Check for relevant linked scripts for this HandAnimator, specifically to the SG_HandModelInfo. </summary>
 protected override void CheckForScripts()
 {
     base.CheckForScripts();
     SG_Util.CheckForHandInfo(this.transform, ref this.handModelInfo);
     if (this.foreArmTransfrom == null)
     {
         this.foreArmTransfrom = handModelInfo.foreArmTransform;
     }
     if (this.wristTransfrom == null)
     {
         this.wristTransfrom = handModelInfo.wristTransform;
     }
 }
示例#6
0
 /// <summary> Assign the joints of this script so that the SG_HandAnimator script takes over animation. </summary>
 protected override void CollectFingerJoints()
 {
     SG_Util.CheckForHandInfo(this.transform, ref this.handModelInfo);
     if (this.handModelInfo != null)
     {
         this.fingerJoints = handModelInfo.FingerJoints;
         if (this.foreArmTransfrom == null)
         {
             this.foreArmTransfrom = handModelInfo.foreArmTransform;
         }
         if (this.wristTransfrom == null)
         {
             this.wristTransfrom = handModelInfo.wristTransform;
         }
     }
 }
示例#7
0
 /// <summary> Setup and check for connected scripts </summary>
 public override void CheckForScripts()
 {
     base.CheckForScripts();
     SG_Util.CheckForHandInfo(this.transform, ref this.handModel);
 }