Beispiel #1
0
    IEnumerator Init()
    {
        while (ansCards.fLoaded == false)
        {
            yield return(new WaitForSeconds(0.1f));
        }

        ansCards.loadCardList("Cards");
        cardCount = ansCards.cardList.Count;
        if (cardCount == 0)
        {
            Debug.Log("No configuration available for selected option");
        }
        else
        {
            uiTxtLevelName.text = globalData.path [globalData.pathDepth];
            urTestCard          = new uniqueRand(0, cardCount - 1);
            testScore.resetScore();
            ansCardSo [0].GetComponent <ansCardGo> ().init(0);
            ansCardSo [1].GetComponent <ansCardGo> ().init(1);
            ansCardSo [2].GetComponent <ansCardGo> ().init(2);
            ansCardSo [3].GetComponent <ansCardGo> ().init(3);

            showNextCard();
        }
    }
 IEnumerator Init()
 {
     while (spaceCards.fLoaded == false)
     {
         yield return(new WaitForSeconds(0.1f));
     }
     spaceCards.loadCardList("Cards");
     cardCount = spaceCards.cardList.Count;
     if (cardCount == 0)
     {
         Debug.Log("No configuration available for selected option");
         yield break;
     }
     newCard();
     StartCoroutine(SpawnWaves());
 }
Beispiel #3
0
    IEnumerator Init()
    {
        while (flashCards.fLoaded == false)
        {
            yield return(new WaitForSeconds(0.1f));
        }
        flashCards.loadCardList("Cards");
        cardCount = flashCards.cardList.Count;
        if (cardCount == 0)
        {
            Debug.Log("No configuration available for selected option");
            yield break;
        }

        rIndexArray = new int[cardCount];
        //Order in which to show the cards


        //if shuffle flag is set, the array is set in a random order
        if (flashCards.fShuffle)
        {
            uniqueRand r = new uniqueRand(0, cardCount - 1);
            r.resetUniqueRandomInt();
            for (int i = 0; i < cardCount; i++)
            {
                rIndexArray [i] = r.nextRandom();
            }
        }
        else
        {
            //if shuffle flag is not set, the array is set in a sequential order
            for (int i = 0; i < cardCount; i++)
            {
                rIndexArray [i] = i;
            }
        }

        fc1 = (GameObject)Instantiate(cubeFlashCard, fcPlaceHolder1.transform.position, fcPlaceHolder1.transform.rotation);
        fc2 = (GameObject)Instantiate(cubeFlashCard, fcPlaceHolder2.transform.position, fcPlaceHolder2.transform.rotation);
        fc3 = (GameObject)Instantiate(cubeFlashCard, fcPlaceHolder3.transform.position, fcPlaceHolder3.transform.rotation);

        fc1.GetComponent <showFlashCard> ().show(rIndexArray [0]);
        fc2.GetComponent <showFlashCard> ().show(rIndexArray [1]);
        fc3.GetComponent <showFlashCard> ().show(rIndexArray [2]);
        topCard = 0;
    }
Beispiel #4
0
    IEnumerator Init()
    {
        while (matchCards.fLoaded == false)
        {
            yield return(new WaitForSeconds(0.1f));
        }
        matchCards.loadCardList("Cards");
        cardCount = matchCards.cardList.Count;

        if (cardCount == 0)
        {
            Debug.Log("No configuration available for selected option");
            yield break;
        }

        uiTxtLevelName.text = globalData.path [globalData.pathDepth];

        createCards();
        showGame();
    }
    IEnumerator Init()
    {
        while (flashCards.fLoaded == false)
        {
            yield return(new WaitForSeconds(0.1f));
        }
        flashCards.loadCardList("Cards");
        cardCount = flashCards.cardList.Count;
        if (cardCount == 0)
        {
            Debug.Log("No configuration available for selected option");
            yield break;
        }

        randomizeArray();

        /*
         * pnl1 = (GameObject)Instantiate (pnlFlashCard);
         * pnl2 = (GameObject)Instantiate (pnlFlashCard);
         * pnl3 = (GameObject)Instantiate (pnlFlashCard);
         *
         * pnl1.transform.SetParent (pnlSet.transform, false);
         * pnl2.transform.SetParent (pnlSet.transform, false);
         * pnl3.transform.SetParent (pnlSet.transform, false);
         *
         * pnl1.GetComponent<fcPanel>().showPanel(rIndexArray[0]);
         * pnl2.GetComponent<fcPanel>().showPanel(rIndexArray[1]);
         * pnl3.GetComponent<fcPanel>().showPanel(rIndexArray[2]);
         *
         */
        //fc1 = (GameObject) Instantiate (cubeFlashCard, fcPlaceHolder1.transform.position, fcPlaceHolder1.transform.rotation);
        //fc2 = (GameObject) Instantiate (cubeFlashCard, fcPlaceHolder2.transform.position, fcPlaceHolder2.transform.rotation);
        //fc3 = (GameObject) Instantiate (cubeFlashCard, fcPlaceHolder3.transform.position, fcPlaceHolder3.transform.rotation);

//		fc1.GetComponent<showFlashCard1>().show (rIndexArray[0]);
//		fc2.GetComponent<showFlashCard1>().show (rIndexArray[1]);
//		fc3.GetComponent<showFlashCard1>().show (rIndexArray[2]);
        topCard = 0;
    }