public bool tryReleaseObject()
 {
     if (GrabbingInfo.shouldRelease(InteractionController.grabbingInfoSettings, _leapHand, _grabbedObject))
     {
         _lastTimeReleased = Time.time;
         _isGrabbingObject = false;
         disconnectAllBasisPoints();
         disconnectAllFingerPoints();
         DebugGraph.Write("Released");
         return(true);
     }
     return(false);
 }
 public bool tryGrabObject()
 {
     foreach (GameObject closeObject in _closeObjects)
     {
         InteractionObject interactionObject = InteractionObject.getInteractionObject(closeObject);
         if (GrabbingInfo.shouldGrab(InteractionController.grabbingInfoSettings, _leapHand, interactionObject))
         {
             _isGrabbingObject = true;
             _grabbedObject    = interactionObject;
             _cachedRigidbody  = _grabbedObject.rigidbody;
             connectAllFingerPoints(_grabbedObject, InteractionPointConnectMethod.SURFACE);
             connectBasisPoints(_grabbedObject);
             DebugGraph.Write("Grabbed");
             return(true);
         }
     }
     return(false);
 }
示例#3
0
    void Update()
    {
        BooleanValue = Mathf.Repeat(Time.time, 1.0f) > 0.5f;

        FloatValue = Mathf.PingPong(Time.realtimeSinceStartup, 1.0f);

        IntValue = Mathf.FloorToInt(FloatValue * 10.0f);

        Vector2Value = GetComponent <Rigidbody2D>().velocity;

        Vector3Value = transform.position;

        ColorValue = Color.Lerp(DebugGraph.DefaultBlue, new Color(1.0f, 0.75f, 0.25f), Mathf.PingPong(Time.realtimeSinceStartup, 1.0f));

        Color32Value = ColorValue;

        StringValue = "Hello World! The Current Frame Number Is: " + Time.frameCount;

        EnumValue = (ExampleEnum)(Time.frameCount % 3);

        float sin = Mathf.Sin(Mathf.Repeat(Time.time, 6.28f));
        float cos = Mathf.Cos(Mathf.Repeat(Time.time, 6.28f));

        DebugGraph.Log("Color Gradient", ColorValue);

        DebugGraph.Write("String", StringValue);

        DebugGraph.Log("Vector3", Input.mousePosition);

        DebugGraph.Log("Vector4", new Vector4(Random.Range(0.0f, 1.0f), Random.Range(0.0f, 1.0f), Random.Range(0.0f, 1.0f), Random.Range(0.0f, 1.0f)));

        transform.Rotate(Vector3.up, Time.deltaTime * 90.0f);
        DebugGraph.Log("Quaternion", transform.rotation);

        DebugGraph.Log("Rect", new Rect(0, 0, 100, 100));

        DebugGraph.Draw(new Vector2(sin * Time.time, cos * Time.time));

        DebugGraph.MultiLog("Related Variables", DebugGraph.DefaultRed, sin, "Sin");
        DebugGraph.MultiLog("Related Variables", DebugGraph.DefaultGreen, cos, "Cos");

        DebugGraph.Log(FloatValue); //Anonymous Float

        //Anonymous Multi Float
        DebugGraph.MultiLog(cos * 1.1f);
        DebugGraph.MultiLog(cos * 1.2f);
        DebugGraph.MultiLog(cos * 1.3f, "C"); //with Value names
        DebugGraph.MultiLog(cos * 1.4f, "D");
        DebugGraph.MultiLog(cos * 1.5f, "E");

        //Anonymous Values in a Loop
        for (int i = 0; i < 10; i++)
        {
            DebugGraph.MultiLog(DebugGraph.GetUniqueColor(i), sin * (1.0f + i * 0.1f), i.ToString());
        }

        DebugGraph.Log(Mathf.FloorToInt(sin * 10));                                        //Anonymous Integer

        DebugGraph.Log(Mathf.RoundToInt(Mathf.PerlinNoise(Time.time, Time.time) * 1) > 0); //Anonymous Boolean

        //Anonymous Multi Enum
        DebugGraph.MultiLog(EnumValue);
        DebugGraph.MultiLog((ExampleEnum2)(Mathf.PerlinNoise(Time.time, Time.time) * 3));
    }