Exemplo n.º 1
0
        private void Init()
        {
            kinectManager = KinectManager.Instance;
            Instance      = this;

            for (int i = 0; i < goFlowers.transform.childCount; i++)
            {
                Transform t = goFlowers.transform.GetChild(i);
                ListFlower.Add(t.gameObject);
                ListPosFlower.Add(t.position);
                ListScaleFlower.Add(t.localScale);
            }

            HandTrigger htLeft = LeftHand.gameObject.GetComponent <HandTrigger>();

            htLeft.OnHandCollide += OnHandCollide;
            HandTrigger htRight = RightHand.gameObject.GetComponent <HandTrigger>();

            htRight.OnHandCollide += OnHandCollide;

            foreach (GameObject ColliderGO in GOColliderGOs.GetComponent <ColliderFromUser>().ColliderGOs)
            {
                HandTrigger htCollider = ColliderGO.gameObject.GetComponent <HandTrigger>();
                htCollider.OnHandCollide += OnHandCollide;
            }
        }
Exemplo n.º 2
0
 public void OnDisable()
 {
     try
     {
         foreach (GameObject ColliderGO in GOColliderGOs.GetComponent <ColliderFromUser>().ColliderGOs)
         {
             HandTrigger htCollider = ColliderGO.gameObject.GetComponent <HandTrigger>();
             htCollider.OnHandCollide -= OnHandCollide;
         }
         HandTrigger htLeft = LeftHand.gameObject.GetComponent <HandTrigger>();
         htLeft.OnHandCollide -= OnHandCollide;
         HandTrigger htRight = RightHand.gameObject.GetComponent <HandTrigger>();
         htRight.OnHandCollide -= OnHandCollide;
     }
     catch (System.Exception e) { Debug.Log(e); };
 }