// Use this for initialization void Start() { // Finding the hand object if (SceneManager.GetActiveScene().name == "2 - VRHandDemo" || SceneManager.GetActiveScene().name == "1 - VowelPracticeVR") { hands = GameObject.Find("LeapHandController"); } else { hands = GameObject.Find("HandModels"); } // Finding the collision checking scripts - attached to the hand object vowelCollision = hands.GetComponent <CollisionDetectionVowels>(); consonantCollision1 = hands.GetComponent <CollisionDetectionCons1>(); consonantCollision2 = hands.GetComponent <CollisionDetectionCons2>(); consonantCollision3 = hands.GetComponent <CollisionDetectionCons3>(); consonantCollision4 = hands.GetComponent <CollisionDetectionCons4>(); consonantCollision5 = hands.GetComponent <CollisionDetectionCons5>(); // Finding the vowel practice task script ui = GameObject.Find("Canvas"); progress = ui.GetComponent <VowelTasks>(); }
void Start() { // Finding the collision checking scripts - attached to the hand object vowelCollision = hands.GetComponent <CollisionDetectionVowels>(); consonantCollision1 = hands.GetComponent <CollisionDetectionCons1>(); consonantCollision2 = hands.GetComponent <CollisionDetectionCons2>(); consonantCollision3 = hands.GetComponent <CollisionDetectionCons3>(); consonantCollision4 = hands.GetComponent <CollisionDetectionCons4>(); consonantCollision5 = hands.GetComponent <CollisionDetectionCons5>(); }
private void FindHandsAndScripts() { // Finding the correct hand object - the hands have different names for desktop & VR if (SceneManager.GetActiveScene().name == "2 - VRHandDemo" || SceneManager.GetActiveScene().name == "1 - VowelPracticeVR") { hands = GameObject.Find("LeapHandController"); } else { hands = GameObject.Find("HandModels"); } vowelCollision = hands.GetComponent <CollisionDetectionVowels>(); consonantCollision1 = hands.GetComponent <CollisionDetectionCons1>(); consonantCollision2 = hands.GetComponent <CollisionDetectionCons2>(); consonantCollision3 = hands.GetComponent <CollisionDetectionCons3>(); consonantCollision4 = hands.GetComponent <CollisionDetectionCons4>(); consonantCollision5 = hands.GetComponent <CollisionDetectionCons5>(); }