Ejemplo n.º 1
0
 /// <summary> Create new DebugColliders from a list of Colliders of the Grabscript. </summary>
 /// <param name="colliders"></param>
 /// <returns></returns>
 protected static DebugCollider[] ExtractObjects(List <Collider> colliders)
 {
     DebugCollider[] res = new DebugCollider[colliders.Count];
     for (int i = 0; i < colliders.Count; i++)
     {
         res[i] = SenseGlove_PhysDebug.CreateDebugObject(colliders[i]);
     }
     return(res);
 }
Ejemplo n.º 2
0
    //-----------------------------------------------------------------------------------------------
    // Setup

    /// <summary> Setup the Debug Colliders of the fingers and/or palm </summary>
    protected void SetupDebugger()
    {
        if (this.palm == null && this.grabScript.palmCollider != null)
        {
            this.palm = SenseGlove_PhysDebug.CreateDebugObject(this.grabScript.palmCollider);
            this.palm.SetColor(this.canGrabColor);
        }

        if (this.fingers == null) //run only once.
        {
            this.fingers = new DebugCollider[5][]
            {
                SenseGlove_PhysDebug.ExtractObjects(this.grabScript.thumbColliders),
                SenseGlove_PhysDebug.ExtractObjects(this.grabScript.indexColliders),
                SenseGlove_PhysDebug.ExtractObjects(this.grabScript.middleColliders),
                SenseGlove_PhysDebug.ExtractObjects(this.grabScript.ringColliders),
                SenseGlove_PhysDebug.ExtractObjects(this.grabScript.pinkyColliders)
            };
        }

        this.ForceIntentions(this.lastIntention);
        SetDebugMode(this.debugMode);
    }