示例#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);
 }
示例#2
0
 /// <summary> Destroy the debug colliders. </summary>
 protected void CleanupDebugger()
 {
     if (this.palm != null)
     {
         this.palm.DeleteObj();
         this.palm = null;
     }
     if (this.fingers != null)
     {
         for (int f = 0; f < this.fingers.Length; f++)
         {
             for (int j = 0; j < this.fingers[f].Length; j++)
             {
                 this.fingers[f][j].DeleteObj();
             }
         }
         this.fingers = null;
     }
 }
示例#3
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);
    }