Exemplo n.º 1
0
    public void ClickAnswerSubmitBtn()
    {
        float scalarValue;
        float xValue, yValue, zValue;

        if (iptScalar.text == "")
        {
            GameRoot.AddTips("Please input the scalar value");
        }
        else if (iptX.text == "" || iptY.text == "" || iptZ.text == "")
        {
            GameRoot.AddTips("Please input the vector value");
        }
        else if (!float.TryParse(iptScalar.text, out scalarValue) || !float.TryParse(iptX.text, out xValue) || !float.TryParse(iptY.text, out yValue) || !float.TryParse(iptZ.text, out zValue))
        {
            GameRoot.AddTips("Please input numbers");
        }
        else
        {
            if (GCP01.CheckAnswer(scalarValue, xValue, yValue, zValue))
            {
                SetActive(PlatformTips[questionNum - 1], false);
                SetActive(PlatformTipsChecked[questionNum - 1], true);
            }

            Debug.Log("Your answer is Scalar: " + iptScalar.text + ", X: " + iptX.text + ", Y: " + iptY.text + ", Z: " + iptZ.text);

            ClearInputField();
            SetActive(iptPanel, false);

            GCP01.isTriggerQuestion = false;

            if (!DialogueManager.isInDialogue)
            {
                GameRoot.instance.IsLock(false);
            }
        }

        audioService.PlayUIAudio(Constants.audioUIClickBtn);
    }