// 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"); } } } }
// 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"); } } } } }