Exemplo n.º 1
0
    //public void OnCollisionEnter(Collision collision)
    //{
    //    isDouble = (Time.realtimeSinceStartup - lastShot < doubleInterval);
    //    if (!isDouble && Time.realtimeSinceStartup - lastShot < interval) return;
    //    LeapBoxingObject leapObj = collision.gameObject.GetComponent<LeapBoxingObject>();

    //    if (leapObj)
    //    {
    //        //Debug.Log("mang : " + leapObj.maxVelocity.magnitude);
    //        //Debug.Log("velo : " + leapObj.maxVelocity);
    //        //Debug.Log("norm : " + leapObj.maxVelocity.normalized);
    //        //Debug.Log("dir : " + (collision.transform.position - transform.position));
    //        //if (leapObj.maxVelocity.z > 0) return;
    //        //Debug.Log(leapObj.maxVelocity.magnitude);
    //        Vector3 initPos = (Vector3.up * 2) +  (Camera.main.transform.forward * 5);
    //        mentosCopy = Instantiate(mentos, collision.gameObject.transform.position, Quaternion.identity) as GameObject;
    //        mentosCopy.transform.position += initPos;
    //        mentosCopy.rigidbody.AddForce(Camera.main.transform.forward * force);
    //        if (isDouble)
    //        {
    //            mentosCopy = Instantiate(mentos, collision.gameObject.transform.position, Quaternion.identity) as GameObject;
    //            mentosCopy.transform.position += (Camera.main.transform.right * 3) + initPos;
    //            mentosCopy.rigidbody.AddForce(Camera.main.transform.forward * force);
    //            mentosCopy = Instantiate(mentos, collision.gameObject.transform.position, Quaternion.identity) as GameObject;
    //            mentosCopy.transform.position += -(Camera.main.transform.right * 3) + initPos;
    //            mentosCopy.rigidbody.AddForce(Camera.main.transform.forward * force);
    //        }
    //        lastShot = Time.realtimeSinceStartup;
    //    }
    //}

    void Start()
    {
        LeapHandController hc = GameObject.Find("Leap Controller Multiple/_leapController").GetComponent<LeapHandController>();
        ind1 = GameObject.Find("OVRCameraController/CameraLeft/h1Ind").renderer;
        ind2 = GameObject.Find("OVRCameraController/CameraRight/h2Ind").renderer;
        nt = GameObject.Find("Networking").GetComponent<Networking>();
        h1 = hc.unityHands[0];
        h2 = hc.unityHands[1];
        _mechaController = GameObject.Find("Mecha").GetComponent<UpdateMechaRotation>();

        interval = _mechaController.animation.GetClip("Left Shot").length;
    }
Exemplo n.º 2
0
    void Update()
    {
        UnityHand unityHand = GetComponent <UnityHand>();

        if (unityHand.GetLeapHand().GrabStrength > 0.4f)
        {
            unityHand.EnableMesh(false);
        }
        else
        {
            unityHand.EnableMesh(true);
        }
    }
Exemplo n.º 3
0
 public virtual void SetOwner(UnityHand h)
 {
     unityHand = h;
 }
Exemplo n.º 4
0
 public FingerDetection(UnityHand hand)
 {
     unityHand = hand;
 }
Exemplo n.º 5
0
 public FingerDetection(UnityHand hand)
 {
     unityHand = hand;
 }
Exemplo n.º 6
0
 bool canFire(UnityHand h)
 {
     return isHandExists(h);
     print("Closed : " + isHandClosed(h));
     print("Exists : " + isHandExists(h));
     return isHandClosed(h) && isHandExists(h);
 }
Exemplo n.º 7
0
 bool isHandClosed(UnityHand h)
 {
     //print(h.leapFingers.Count + " : " + h.unityFingers.Count);
     return (h.leapFingers.Count < 2);
 }
Exemplo n.º 8
0
 bool isHandExists(UnityHand h)
 {
     return h.handFound;
 }
Exemplo n.º 9
0
 bool isHandClosed(UnityHand h)
 {
     return (h.leapFingers.Count < 2);
 }
Exemplo n.º 10
0
 bool canFire(UnityHand h)
 {
     return isHandClosed(h) && isHandExists(h);
 }
Exemplo n.º 11
0
 public virtual void SetOwner(UnityHand h)
 {
     unityHand = h;
 }