Exemplo n.º 1
0
        private void SetupSuitCases()
        {
            Debug.Log("Number of suitcases: " + game.suitcases.Count);

            List <ILivingLetterData> tempCorrect = correctAnswers.ToList();

            for (int i = 0; i < game.suitcases.Count; i++)
            {
                ScannerSuitcase ss = game.suitcases[i];
                ss.Reset();

                if (tempCorrect.Count > 0 && wrongAnswers.Count > 0)
                {
                    int coinFlip = UnityEngine.Random.Range(1, 5);
                    if (coinFlip == 1)
                    {
                        AddDataToSuitcase(ss, tempCorrect, true);
                    }
                    else
                    {
                        AddDataToSuitcase(ss, wrongAnswers, false);
                    }
                }
                else if (tempCorrect.Count > 0)
                {
                    AddDataToSuitcase(ss, tempCorrect, true);
                    ss.isCorrectAnswer = true;
                }
                else if (wrongAnswers.Count > 0)
                {
                    AddDataToSuitcase(ss, wrongAnswers, false);
                }
            }
        }
Exemplo n.º 2
0
        private void AddDataToSuitcase(ScannerSuitcase ss, List <ILivingLetterData> fromList, bool isCorrect)
        {
            var ans = fromList.RandomSelectOne();

            ss.drawing.text    = ans.DrawingCharForLivingLetter;
            ss.wordId          = ans.Id;
            ss.isCorrectAnswer = isCorrect;
            fromList.Remove(ans);
        }
Exemplo n.º 3
0
        void matchLLToSS(ScannerLivingLetter targetLL)
        {
            currentLL = targetLL;

            foreach (ScannerSuitcase sc in game.suitcases)
            {
                if (targetLL.letterObjectView.Data.Id == sc.wordId)
                {
                    currentSuitcases = sc;
                    source           = sc.transform;
                    target           = targetLL.transform;
                    break;
                }
            }
        }