コード例 #1
0
ファイル: GestureCatcher.cs プロジェクト: marcomnt/RV
    // Update is called once per frame
    void Update()
    {
        RigidHand[] handsCatcher = (RigidHand[])GameObject.FindObjectsOfType(typeof(RigidHand));

        foreach (RigidHand hand in handsCatcher)
        {
            LeapHand lHand = new LeapHand(hand);
            if (this.hands[0].handedness == lHand.handedness)
            {
                if (handComp.compareHand(this.hands[0], lHand))
                {
                    this.playershooting.Shoot();
                    Debug.Log("DDDAAALLEEEEE");
                }
            }
            else
            {
                if (handComp.compareHand(this.hands[1], lHand))
                {
                    this.playershooting.Shoot();
                    Debug.Log("EEEEELLAAADDD");
                }
            }
        }
    }
コード例 #2
0
    // Update is called once per frame
    void Update()
    {
        RigidHand[] handsCatcher = (RigidHand[])GameObject.FindObjectsOfType(typeof(RigidHand));
        LeapHand[]  hands        = GetComponent <HandRegister>().hands;

        foreach (RigidHand hand in handsCatcher)
        {
            LeapHand lHand = new LeapHand(hand);

            foreach (LeapHand savedHand in hands)
            {
                if (savedHand.handedness == lHand.handedness)
                {
                    if (handComp.compareHand(savedHand, lHand))
                    {
                        Debug.Log("ITS ALIVE");
                    }
                }
            }
        }
    }