Exemple #1
0
    //---------------------------------------------------------------------------------------------------------------------
    // Monobehaviour

    #region Monobehaviour

    // Use this for initialization
    void Start()
    {
        this.senseGlove = this.gameObject.GetComponent <SenseGlove_Object>();
        if (this.senseGlove != null)
        {
            this.senseGlove.OnCalibrationFinished += SenseGlove_OnCalibrationFinished;
        }
        this.grabScript = this.gameObject.GetComponent <SenseGlove_PhysGrab>();
    }
 /// <summary>  If this WireFrame model has a grabscript, attach the appropriate colliders. </summary>
 private void SetupGrabColliders()
 {
     if (!this.setupComplete)
     {
         SenseGlove_PhysGrab grabscript = this.GetComponent <SenseGlove_PhysGrab>();
         if (grabscript != null)
         {
             //attack capsule colliders to the fingers
             SenseGlove_Debugger.Log("Grabscript detected! Attaching colliders.");
             List <List <Collider> > pickups = new List <List <Collider> >();
             for (int f = 0; f < handPositions.Length; f++) //DEBUG : Only thumb & index
             {
                 List <Collider> fingerColliders = new List <Collider>();
                 GameObject      fingerTip       = this.handPositions[f][handPositions[f].Length - 1];
                 SphereCollider  C = fingerTip.AddComponent <SphereCollider>();
                 //        C.radius = grabscript.pickupColliderSize; //determine collider size
                 fingerColliders.Add(C);
                 pickups.Add(fingerColliders);
             }
             grabscript.Setup(pickups, this.palmCollider);
         }
         //else try other forms of grabscripts
     }
 }
    //---------------------------------------------------------------------------------------------------------------------
    // Monobehaviour

    #region Monobehaviour

    // Use this for initialization
    void Start()
    {
        this.senseGlove = this.gameObject.GetComponent <SenseGlove_Object>();
        this.grabScript = this.gameObject.GetComponent <SenseGlove_PhysGrab>();
    }
Exemple #4
0
    //-----------------------------------------------------------------------------------------------
    // Monobehaviour

    // Use this for initialization
    protected virtual void Start()
    {
        this.grabScript = this.gameObject.GetComponent <SenseGlove_PhysGrab>();
    }