예제 #1
0
        private IQuestion GenerateMissingLetterQuestion(ILivingLetterData data, ILivingLetterData letterToRemove)
        {
            var           imageData = new LL_ImageData(data.Id);
            LL_WordData   word      = (LL_WordData)data;
            LL_LetterData letter    = (LL_LetterData)letterToRemove;

            cacheCompleteWord = word.TextForLivingLetter;

            var partsToRemove = LanguageSwitcher.I.GetHelper(LanguageUse.Learning).FindLetter(AppManager.I.DB, word.Data, letter.Data, LetterEqualityStrictness.Letter);

            partsToRemove.Shuffle(); //pick a random letter

            string text = LanguageSwitcher.I.GetHelper(LanguageUse.Learning).GetWordWithMissingLetterText(
                word.Data, partsToRemove[0], removedLetterColor: "#000000");

            //Spawn word, then replace text with text with missing letter
            var wordGO = ItemFactory.Instance.SpawnQuestion(word);

            wordGO.InstaShrink();

            wordGO.Label.text   = text;
            cacheCompleteWordLL = wordGO;

            wordGO.SetExtendedBoxCollider();

            return(new ImageQuestion(wordGO, imageData, audioManager));
        }
예제 #2
0
 private IEnumerator ImageShowAnimation(StillLetterBox letter)
 {
     letter.Poof();
     audioManager.PlayPoofSound();
     letter.Magnify();
     yield return(Wait.For(0.9f));
 }
예제 #3
0
        protected void WrapQuestionInABox(IQuestion q)
        {
            var ll = q.gameObject.GetComponent <StillLetterBox>();
            int placeholdersCount = 0;

            foreach (var p in q.GetPlaceholders())
            {
                placeholdersCount++;
            }

            StillLetterBox[] boxes = new StillLetterBox[placeholdersCount + 1];

            placeholdersCount = 0;
            foreach (var p in q.GetPlaceholders())
            {
                boxes[placeholdersCount++] = p.GetComponent <StillLetterBox>();
            }
            boxes[boxes.Length - 1] = ll;

            var box = ItemFactory.Instance.SpawnQuestionBox(boxes);

            box.Show();
            audioManager.PlayPoofSound();

            boxesList.Add(box);
        }
예제 #4
0
        IEnumerator FadeOutImage(StillLetterBox image)
        {
            audioManager.PlayPoofSound();
            image.Poof();

            image.transform.DOScale(0, 0.4f).OnComplete(() => GameObject.Destroy(image.gameObject));
            yield return(Wait.For(0.1f));
        }
예제 #5
0
        public DefaultQuestion(StillLetterBox letter, int placeholders, AssessmentAudioManager dialogues)
        {
            view = letter;
            placeholdersCount = placeholders;
            placeholdersSet   = new List <GameObject>();
            var question = letter.gameObject.AddComponent <QuestionBehaviour>();

            question.SetQuestion(this, dialogues);
        }
예제 #6
0
        public ImageQuestion(StillLetterBox wordGO, ILivingLetterData image, AssessmentAudioManager dialogues)
        {
            imageData       = image;
            view            = wordGO;
            placeholdersSet = new List <GameObject>();

            var question = wordGO.gameObject.AddComponent <QuestionBehaviour>();

            question.SetQuestion(this, dialogues);
        }
예제 #7
0
        private IQuestion GenerateQuestion(ILivingLetterData data)
        {
            cacheFullWordData = new LL_WordData(data.Id);

            if (AssessmentOptions.Instance.ShowQuestionAsImage)
            {
                data = new LL_ImageData(data.Id);
            }

            cacheFullWordDataLL = ItemFactory.Instance.SpawnQuestion(data);
            return(new DefaultQuestion(cacheFullWordDataLL, 0, audioManager));
        }
예제 #8
0
        protected void PlaceImage(IQuestion q, Vector3 imagePos)
        {
            var ll = ItemFactory.Instance.SpawnQuestion(q.Image());

            cacheImage = ll;

            images.Add(ll);
            ll.transform.position = imagePos;
            ll.InstaShrink();

            AnimationsQueue.Add(ImageShowAnimation(ll));
        }
예제 #9
0
 private void RemovePlaceholder(StillLetterBox box)
 {
     box.transform.DOScale(0, 0.3f).OnComplete(() => GameObject.Destroy(box));
 }
예제 #10
0
 private void AddCompleteWordEvent(string completeText, StillLetterBox target)
 {
     cacheWordsToComplete.Add(target);
     cacheCompleteWords.Add(completeText);
 }
예제 #11
0
 private IEnumerator PlaceholderShowAnimation(StillLetterBox box)
 {
     audioManager.PlayPlaceSlot();
     box.Magnify();
     yield return(Wait.For(0.2f));
 }