Ejemplo n.º 1
0
    private void ValidateSentence()
    {
        SentenceWrapper[] Sentences = Spawner.GetSentences();

        var feedbackText = Instantiate(FeedbackTextPrefab, transform);

        foreach (var t in Sentences)
        {
            if (t.Sentence + " " == Sentence.text)
            {
                PointManager.AlterPoints(t.PointValue);
                if (t.PointValue > 0)
                {
                    ConfettiCanon.Play();
                    GirlAnimator.SetTrigger("tYes");
                    feedbackText.text      = "+" + t.PointValue;
                    feedbackText.faceColor = Color.green;
                }
                else
                {
                    GirlAnimator.SetTrigger("tNo");
                    feedbackText.text      = t.PointValue.ToString();
                    feedbackText.faceColor = Color.red;
                }
                return;
            }
        }

        feedbackText.text = "???";
        GirlAnimator.SetTrigger("tWhat");
        Debug.Log("Player got no points, nonsense Sentence");
    }