Ejemplo n.º 1
0
    private void changeTexts()
    {
        switch (currentscreen)
        {
        case currentScreen.Name:
            explanationTxt.text = TypeNameStr;
            buttonTexts[1].text = "OK";
            break;

        case currentScreen.Explain:
            explanationTxt.text = ExplainStr;
            buttonTexts[1].text = "Practice";
            break;

        case currentScreen.Result:
            if (practiceWasCorrect)
            {
                explanationTxt.text = ResultCorrect;
                buttonTexts[1].text = "Start!";
            }
            else
            {
                explanationTxt.text = ResultWrong;
                buttonTexts[1].text = "Try again";
                currentscreen       = currentScreen.Explain;
            }
            break;

        default: break;
        }
    }
Ejemplo n.º 2
0
 public void topButton()
 {
     audioSource.Play();
     // Only displayed in the initial screen
     currentscreen = currentScreen.Name;
     inputField.SetActive(true);
     buttons[0].SetActive(false);
     changeTexts();
 }
Ejemplo n.º 3
0
        /// <summary>
        /// for basic options that are just clicks
        /// </summary>
        /// <param name="text"></param>
        /// <param name="changeScreen"></param>
        /// <param name="x"></param>
        /// <param name="y"></param>
        public Button(string text, currentScreen changeScreen, int x, int y)
        {
            this.text         = text;
            this.changeScreen = changeScreen;
            this.x            = x;
            this.y            = y;
            Vector2 stringXAndY = LarrysAngelWarfare.font.MeasureString(text);

            this.x -= (int)stringXAndY.X / 2;
            rect    = new Rectangle(this.x, this.y, (int)stringXAndY.X, (int)stringXAndY.Y);
        }
Ejemplo n.º 4
0
    public void bottomButton()
    {
        audioSource.Play();
        switch (currentscreen)
        {
        case currentScreen.Title:
            SceneManager.LoadScene("Title"); break;

        case currentScreen.Name:
            if (inputText.text == "")
            {
                explanationTxt.text = NameEmptyString;
                break;
            }
            currentscreen = currentScreen.ExplainApple;
            AttentionController.playerName = inputText.text;
            changeTexts();
            inputField.SetActive(false);
            sampleApple.SetActive(true);
            break;

        case currentScreen.ExplainApple:
            currentscreen = currentScreen.ExplainOrder;
            changeTexts();
            break;

        case currentScreen.ExplainOrder:
            currentscreen = currentScreen.PracticeApple;
            setPracticeScreenActive(true);
            break;

        case currentScreen.ResultApple:
            currentscreen = currentScreen.Explainorange;
            sampleOrange.SetActive(true);
            changeTexts();
            break;

        case currentScreen.Explainorange:
            currentscreen = currentScreen.PracticeOrange;
            setPracticeScreenActive(true);
            break;

        case currentScreen.ResultOrange:
            currentscreen = currentScreen.Countdown;
            buttons[1].SetActive(false);
            StartCoroutine("CountDown");
            break;

        default:
            break;
        }
    }
Ejemplo n.º 5
0
    void Start()
    {
        currentscreen = currentScreen.Title;
        inputField.SetActive(false);
        mainGameObjects.SetActive(false);

        buttonTexts = new Text[2];
        for (int i = 0; i < 2; ++i)
        {
            buttonTexts[i] = buttons[i].GetComponentInChildren <Text>();
        }
        audioSource = GetComponent <AudioSource>();
    }
Ejemplo n.º 6
0
    void Start()
    {
        currentscreen = currentScreen.Title;
        mainGameObjects.SetActive(false);
        fruits.SetActive(false);
        audioSource = this.GetComponent <AudioSource>();
        imageSetter = this.GetComponent <ImageSetter>();

        buttonTexts = new Text[2];
        for (int i = 0; i < 2; ++i)
        {
            buttonTexts[i] = buttons[i].GetComponentInChildren <Text>();
        }
    }
Ejemplo n.º 7
0
    IEnumerator PracticeEnd()
    {
        yield return(new WaitForSeconds(1f));

        if (currentscreen == currentScreen.PracticeApple)
        {
            currentscreen = currentScreen.ResultApple;
        }
        else
        {
            currentscreen = currentScreen.ResultOrange;
        }
        setPracticeScreenActive(false);
        imageSetter.displayCircle(-1);
        changeTexts();
    }
    void Start()
    {
        currentscreen = currentScreen.Title;
        inputField.SetActive(false);
        numCorrect = 0;

        practiceCalculations    = new Calculation[3];
        practiceCalculations[0] = new Calculation(2, 5, Operation.add);
        practiceCalculations[1] = new Calculation(12, 4, Operation.subtract);
        practiceCalculations[2] = new Calculation(6, 3, Operation.muptiply);

        buttonTexts = new Text[6];
        for (int i = 0; i < 6; ++i)
        {
            buttonTexts[i] = buttons[i].GetComponentInChildren <Text>();
        }
        audioSource = GetComponent <AudioSource>();
    }
Ejemplo n.º 9
0
 public void answerButton(int location) // used for answer button
 {
     audioSource.Play();
     if (location == 3)
     {
         practiceWasCorrect = true;
     }
     else
     {
         practiceWasCorrect = false;
     }
     currentscreen = currentScreen.Result;
     practiceGameObject_SelectAns.SetActive(false);
     tutorialObjects.SetActive(true);
     buttons[1].SetActive(true);
     choiceButtons.SetActive(false);
     changeTexts();
 }
Ejemplo n.º 10
0
    public void bottomButton()
    {
        audioSource.Play();
        switch (currentscreen)
        {
        case currentScreen.Title:
            SceneManager.LoadScene("Title"); break;

        case currentScreen.Name:
            if (inputText.text == "")
            {
                explanationTxt.text = "Name cannot\nbe empty.";
            }
            else
            {
                MemorizationController.playerName = inputText.text;
                currentscreen = currentScreen.Explain;
                inputField.SetActive(false);
                changeTexts();
            }
            break;

        case currentScreen.Explain:
            currentscreen = currentScreen.Practice;
            buttons[1].SetActive(false);
            tutorialObjects.SetActive(false);
            practiceGameObject_Display.SetActive(true);
            StartCoroutine(Practice());
            break;

        case currentScreen.Result:
            currentscreen = currentScreen.Countdown;
            buttons[1].SetActive(false);
            StartCoroutine("CountDown");
            break;

        default: break;
        }
    }
Ejemplo n.º 11
0
 public void changeSetArmor()
 {
     cs = currentScreen.Armor;
 }
Ejemplo n.º 12
0
 public void backToStart()
 {
     cs = currentScreen.LocChoice;
 }
Ejemplo n.º 13
0
 public void changeSetWeapon()
 {
     cs = currentScreen.Wep;
 }
Ejemplo n.º 14
0
 public void potShop()
 {
     cs = currentScreen.Potion;
 }
Ejemplo n.º 15
0
 public void ruins()
 {
     cs = currentScreen.Level;
 }
Ejemplo n.º 16
0
 public void addButton(string OptionText, currentScreen changeScreen, int x, int y)
 {
     optionList.Add(new Button(OptionText, changeScreen, x, y));
 }
Ejemplo n.º 17
0
 public void backToSmith()
 {
     cs = currentScreen.SmithChoice;
 }