// this method will be used to create the variety of letters that will be dropping, storing them into an array. public void createCoconuts() { for (int i = 0; i < coconutImages.Length; i++) { SpawnCoconuts currCoconut; if (i == 0) { currCoconut = coconut; } else { currCoconut = Instantiate(coconut) as SpawnCoconuts; } thisCoconut = currCoconut.setCoconut (coconutImages [i], letterSounds[i], i, letters[i]); //currCoconut.GetComponent<Rigidbody2D> ().gravityScale = 0; allCoconuts.Add (thisCoconut); // store all of the coconuts that are created into an array so we can use this for dropping } }
// this method will be used to create the variety of letters that will be dropping, storing them into an array. public void createCoconuts() { for (int i = 0; i < coconutImages.Length; i++) { SpawnCoconuts currCoconut; if (i == 0) { currCoconut = coconut; } else { currCoconut = Instantiate(coconut) as SpawnCoconuts; } thisCoconut = currCoconut.setCoconut(coconutImages [i], letterSounds[i], i); //currCoconut.GetComponent<Rigidbody2D> ().gravityScale = 0; allCoconuts.Add(thisCoconut); // store all of the coconuts that are created into an array so we can use this for dropping } }