示例#1
0
    // 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
        }
    }
示例#2
0
    // 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
        }
    }