示例#1
0
 public void CheckResult()
 {
     RobotLight.GetComponent <Light>().enabled = true;
     if (int.TryParse(resultBox.GetComponent <InputField>().text, out result))
     {
         if (result == X * Y)
         {
             correct.SetActive(true);
             RobotEye.GetComponent <MeshRenderer>().material = correctMat;
             RobotLight.GetComponent <Light>().color         = correctColor;
             StartCoroutine(OtherQuestion());
             RobotBody.GetComponent <Animation>().clip = RobotBody.GetComponent <Animation>().GetClip("Good");
             RobotBody.GetComponent <Animation>().Play();
         }
         else
         {
             wrong.SetActive(true);
             RobotEye.GetComponent <MeshRenderer>().material = wrongMat;
             RobotLight.GetComponent <Light>().color         = wrongColor;
             StartCoroutine(OtherQuestion());
             RobotBody.GetComponent <Animation>().clip = RobotBody.GetComponent <Animation>().GetClip("Wrong");
             RobotBody.GetComponent <Animation>().Play();
         }
     }
     else
     {
         confused.SetActive(true);
         RobotEye.GetComponent <MeshRenderer>().material = confusedMat;
         RobotLight.GetComponent <Light>().color         = confusedColor;
         StartCoroutine(QuestionAgain());
         RobotBody.GetComponent <Animation>().clip = RobotBody.GetComponent <Animation>().GetClip("Confused");
         RobotBody.GetComponent <Animation>().Play();
     }
 }
示例#2
0
    public void CheckResult()
    {
        RobotLight.GetComponent <Light>().enabled  = true;
        resultBox.GetComponent <InputField>().text = resultBox.GetComponent <InputField>().text.ToLower();
        if (resultBox.GetComponent <InputField>().text.Contains("give") && resultBox.GetComponent <InputField>().text.Contains("butter") || resultBox.GetComponent <InputField>().text.Contains("make") && resultBox.GetComponent <InputField>().text.Contains("questions"))
        {
            correct.SetActive(true);
            RobotEye.GetComponent <MeshRenderer>().material = correctMat;
            RobotLight.GetComponent <Light>().color         = correctColor;
            StartCoroutine(OtherQuestion());
            RobotBody.GetComponent <Animation>().clip = RobotBody.GetComponent <Animation>().GetClip("Good");
            RobotBody.GetComponent <Animation>().Play();
        }
        else
        {
            wrong.SetActive(true);
            RobotEye.GetComponent <MeshRenderer>().material = wrongMat;
            RobotLight.GetComponent <Light>().color         = wrongColor;
            StartCoroutine(OtherQuestion());
            RobotBody.GetComponent <Animation>().clip = RobotBody.GetComponent <Animation>().GetClip("Wrong");
            RobotBody.GetComponent <Animation>().Play();
        }

        if (resultBox.GetComponent <InputField>().text.Equals("be my friend", System.StringComparison.CurrentCultureIgnoreCase))
        {
            confused.SetActive(true);
            RobotEye.GetComponent <MeshRenderer>().material = confusedMat;
            RobotLight.GetComponent <Light>().color         = confusedColor;
            StartCoroutine(QuestionAgain());
            RobotBody.GetComponent <Animation>().clip = RobotBody.GetComponent <Animation>().GetClip("Confused");
            RobotBody.GetComponent <Animation>().Play();
        }
    }
示例#3
0
 public void CheckResult()
 {
     RobotLight.GetComponent <Light>().enabled = true;
     if (resultBox.GetComponent <InputField>().text.Equals("even", System.StringComparison.CurrentCultureIgnoreCase) || resultBox.GetComponent <InputField>().text.Equals("odd", System.StringComparison.CurrentCultureIgnoreCase))
     {
         bool even = resultBox.GetComponent <InputField>().text.Equals("even", System.StringComparison.CurrentCultureIgnoreCase) ? true : false;
         if (even == evenState)
         {
             correct.SetActive(true);
             RobotEye.GetComponent <MeshRenderer>().material = correctMat;
             RobotLight.GetComponent <Light>().color         = correctColor;
             StartCoroutine(OtherQuestion());
             RobotBody.GetComponent <Animation>().clip = RobotBody.GetComponent <Animation>().GetClip("Good");
             RobotBody.GetComponent <Animation>().Play();
         }
         else
         {
             wrong.SetActive(true);
             RobotEye.GetComponent <MeshRenderer>().material = wrongMat;
             RobotLight.GetComponent <Light>().color         = wrongColor;
             StartCoroutine(OtherQuestion());
             RobotBody.GetComponent <Animation>().clip = RobotBody.GetComponent <Animation>().GetClip("Wrong");
             RobotBody.GetComponent <Animation>().Play();
         }
     }
     else
     {
         confused.SetActive(true);
         RobotEye.GetComponent <MeshRenderer>().material = confusedMat;
         RobotLight.GetComponent <Light>().color         = confusedColor;
         StartCoroutine(QuestionAgain());
         RobotBody.GetComponent <Animation>().clip = RobotBody.GetComponent <Animation>().GetClip("Confused");
         RobotBody.GetComponent <Animation>().Play();
     }
 }
示例#4
0
 IEnumerator QuestionAgain()
 {
     yield return new WaitForSeconds(3);
     confused.SetActive(false);
     RobotLight.GetComponent<Light>().enabled = false;
     RobotEye.GetComponent<MeshRenderer>().material = normalMat;
     RobotBody.GetComponent<Animation>().Stop();
 }
示例#5
0
    public void CheckResult()
    {
        RobotLight.GetComponent <Light>().enabled = true;
        if (!resultBox.GetComponent <InputField>().text.Contains("1") &&
            !resultBox.GetComponent <InputField>().text.Contains("2") &&
            !resultBox.GetComponent <InputField>().text.Contains("3") &&
            !resultBox.GetComponent <InputField>().text.Contains("4") &&
            !resultBox.GetComponent <InputField>().text.Contains("5") &&
            !resultBox.GetComponent <InputField>().text.Contains("6") &&
            !resultBox.GetComponent <InputField>().text.Contains("7") &&
            !resultBox.GetComponent <InputField>().text.Contains("8") &&
            !resultBox.GetComponent <InputField>().text.Contains("9") &&
            !resultBox.GetComponent <InputField>().text.Contains("0"))
        {
            switch (index)
            {
            case 0: response = "Act"; break;

            case 1: response = "Eon"; break;

            case 2: response = "Be Re"; break;

            case 3: response = "God"; break;

            case 4: response = "Rec Of"; break;

            case 5: response = "Lube"; break;
            }

            if (resultBox.GetComponent <InputField>().text.Equals(response, System.StringComparison.CurrentCultureIgnoreCase))
            {
                correct.SetActive(true);
                RobotEye.GetComponent <MeshRenderer>().material = correctMat;
                RobotLight.GetComponent <Light>().color         = correctColor;
                StartCoroutine(OtherQuestion());
                RobotBody.GetComponent <Animation>().clip = RobotBody.GetComponent <Animation>().GetClip("Good");
                RobotBody.GetComponent <Animation>().Play();
            }
            else
            {
                wrong.SetActive(true);
                RobotEye.GetComponent <MeshRenderer>().material = wrongMat;
                RobotLight.GetComponent <Light>().color         = wrongColor;
                StartCoroutine(OtherQuestion());
                RobotBody.GetComponent <Animation>().clip = RobotBody.GetComponent <Animation>().GetClip("Wrong");
                RobotBody.GetComponent <Animation>().Play();
            }
        }
        else
        {
            confused.SetActive(true);
            RobotEye.GetComponent <MeshRenderer>().material = confusedMat;
            RobotLight.GetComponent <Light>().color         = confusedColor;
            StartCoroutine(QuestionAgain());
            RobotBody.GetComponent <Animation>().clip = RobotBody.GetComponent <Animation>().GetClip("Confused");
            RobotBody.GetComponent <Animation>().Play();
        }
    }
示例#6
0
    public void CheckResult()
    {
        RobotLight.GetComponent<Light>().enabled = true;
        if (!resultBox.GetComponent<InputField>().text.Contains("1") &&
            !resultBox.GetComponent<InputField>().text.Contains("2") &&
            !resultBox.GetComponent<InputField>().text.Contains("3") &&
            !resultBox.GetComponent<InputField>().text.Contains("4") &&
            !resultBox.GetComponent<InputField>().text.Contains("5") &&
            !resultBox.GetComponent<InputField>().text.Contains("6") &&
            !resultBox.GetComponent<InputField>().text.Contains("7") &&
            !resultBox.GetComponent<InputField>().text.Contains("8") &&
            !resultBox.GetComponent<InputField>().text.Contains("9") &&
            !resultBox.GetComponent<InputField>().text.Contains("0"))
        {
            switch (index)
            {
                case 0: capital = "Santiago"; break;
                case 1: capital = "Lima"; break;
                case 2: capital = "La Paz"; break;
                case 3: capital = "Buenos Aires"; break;
                case 4: capital = "Brasilia"; break;
                case 5: capital = "Mexico"; break;
           
            }

            if (resultBox.GetComponent<InputField>().text.Equals(capital,System.StringComparison.CurrentCultureIgnoreCase))
            {
                correct.SetActive(true);
                RobotEye.GetComponent<MeshRenderer>().material = correctMat;
                RobotLight.GetComponent<Light>().color = correctColor;
                StartCoroutine(OtherQuestion());
                RobotBody.GetComponent<Animation>().clip = RobotBody.GetComponent<Animation>().GetClip("Good");
                RobotBody.GetComponent<Animation>().Play();
            }
            else
            {
                wrong.SetActive(true);
                RobotEye.GetComponent<MeshRenderer>().material = wrongMat;
                RobotLight.GetComponent<Light>().color = wrongColor;
                StartCoroutine(OtherQuestion());
                resultBox.GetComponent<InputField>().text = "";
                RobotBody.GetComponent<Animation>().clip = RobotBody.GetComponent<Animation>().GetClip("Wrong");
                RobotBody.GetComponent<Animation>().Play();
            }
        }
        else
        {
            confused.SetActive(true);
            RobotEye.GetComponent<MeshRenderer>().material = confusedMat;
            RobotLight.GetComponent<Light>().color = confusedColor;
            StartCoroutine(QuestionAgain());
            RobotBody.GetComponent<Animation>().clip = RobotBody.GetComponent<Animation>().GetClip("Confused");
            RobotBody.GetComponent<Animation>().Play();
        }
    }
示例#7
0
 IEnumerator OtherQuestion()
 {
     yield return new WaitForSeconds(3);
     wrong.SetActive(false);
     correct.SetActive(false);
     RobotLight.GetComponent<Light>().enabled = false;
     RobotEye.GetComponent<MeshRenderer>().material = normalMat;
     QuestionManager.TextChange();
     resultBox.GetComponent<InputField>().text = "";
     RobotBody.GetComponent<Animation>().Stop();
     Start();
 }
示例#8
0
    public void CheckResult()
    {
        RobotLight.GetComponent <Light>().enabled = true;
        if (!resultBox.GetComponent <InputField>().text.Contains("1") &&
            !resultBox.GetComponent <InputField>().text.Contains("2") &&
            !resultBox.GetComponent <InputField>().text.Contains("3") &&
            !resultBox.GetComponent <InputField>().text.Contains("4") &&
            !resultBox.GetComponent <InputField>().text.Contains("5") &&
            !resultBox.GetComponent <InputField>().text.Contains("6") &&
            !resultBox.GetComponent <InputField>().text.Contains("7") &&
            !resultBox.GetComponent <InputField>().text.Contains("8") &&
            !resultBox.GetComponent <InputField>().text.Contains("9") &&
            !resultBox.GetComponent <InputField>().text.Contains("0"))
        {
            char[] charArray = resultBox.GetComponent <InputField>().text.ToCharArray();
            Array.Reverse(charArray);
            string reversedString = new string(charArray);

            if (resultBox.GetComponent <InputField>().text.Equals(reversedString, StringComparison.CurrentCultureIgnoreCase))
            {
                correct.SetActive(true);
                RobotEye.GetComponent <MeshRenderer>().material = correctMat;
                RobotLight.GetComponent <Light>().color         = correctColor;
                StartCoroutine(OtherQuestion());
                RobotBody.GetComponent <Animation>().clip = RobotBody.GetComponent <Animation>().GetClip("Good");
                RobotBody.GetComponent <Animation>().Play();
            }
            else
            {
                wrong.SetActive(true);
                RobotEye.GetComponent <MeshRenderer>().material = wrongMat;
                RobotLight.GetComponent <Light>().color         = wrongColor;
                StartCoroutine(OtherQuestion());
                RobotBody.GetComponent <Animation>().clip = RobotBody.GetComponent <Animation>().GetClip("Wrong");
                RobotBody.GetComponent <Animation>().Play();
            }
        }
        else
        {
            confused.SetActive(true);
            RobotEye.GetComponent <MeshRenderer>().material = confusedMat;
            RobotLight.GetComponent <Light>().color         = confusedColor;
            StartCoroutine(QuestionAgain());
            RobotBody.GetComponent <Animation>().clip = RobotBody.GetComponent <Animation>().GetClip("Confused");
            RobotBody.GetComponent <Animation>().Play();
        }
    }
示例#9
0
 public void CheckResult(int id)
 {
     RobotLight.GetComponent <Light>().enabled = true;
     if (id == 3)
     {
         correct.SetActive(true);
         RobotEye.GetComponent <MeshRenderer>().material = correctMat;
         RobotLight.GetComponent <Light>().color         = correctColor;
         StartCoroutine(OtherQuestion());
         RobotBody.GetComponent <Animation>().clip = RobotBody.GetComponent <Animation>().GetClip("Good");
         RobotBody.GetComponent <Animation>().Play();
     }
     else
     {
         wrong.SetActive(true);
         RobotEye.GetComponent <MeshRenderer>().material = wrongMat;
         RobotLight.GetComponent <Light>().color         = wrongColor;
         StartCoroutine(OtherQuestion());
         RobotBody.GetComponent <Animation>().clip = RobotBody.GetComponent <Animation>().GetClip("Wrong");
         RobotBody.GetComponent <Animation>().Play();
     }
 }