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; } }
public void topButton() { audioSource.Play(); // Only displayed in the initial screen currentscreen = currentScreen.Name; inputField.SetActive(true); buttons[0].SetActive(false); changeTexts(); }
/// <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); }
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; } }
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>(); }
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>(); } }
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>(); }
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(); }
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; } }
public void changeSetArmor() { cs = currentScreen.Armor; }
public void backToStart() { cs = currentScreen.LocChoice; }
public void changeSetWeapon() { cs = currentScreen.Wep; }
public void potShop() { cs = currentScreen.Potion; }
public void ruins() { cs = currentScreen.Level; }
public void addButton(string OptionText, currentScreen changeScreen, int x, int y) { optionList.Add(new Button(OptionText, changeScreen, x, y)); }
public void backToSmith() { cs = currentScreen.SmithChoice; }