public void Start() { if (!System.IO.File.Exists(Application.persistentDataPath + "/data")) { status = new Minigame1Status(); } else { status = FileManager.ReadFromBinaryFile <Minigame1Status> (Application.persistentDataPath + "/data"); } if (!System.IO.File.Exists(Application.persistentDataPath + "/sendToServer")) { sendToServer = new SendToServer(); } else { sendToServer = FileManager.ReadFromBinaryFile <SendToServer> (Application.persistentDataPath + "/sendToServer"); } picture.GetComponent <Image> ().sprite = Resources.Load("Minigame 1/" + StaticSceneManager.GetSceneImage(), typeof(Sprite)) as Sprite; string imageName = picture.GetComponent <Image> ().sprite.name.ToUpper(); string[] imageNameLanguages = imageName.Split('_'); if (StaticLanguage.getLanguage() == "portuguese") { solution = imageNameLanguages[0]; } if (StaticLanguage.getLanguage() == "english") { solution = imageNameLanguages [1]; } text.text = " "; setBlanks(solution); setButtons(solution); }
void Start() { if (!System.IO.File.Exists(Application.persistentDataPath + "/data")) { status = new Minigame1Status(); } else { status = FileManager.ReadFromBinaryFile <Minigame1Status> (Application.persistentDataPath + "/data"); } if (StaticLanguage.getLanguage().Equals("portuguese")) { instructions.text = "Clique em cada uma das imagens e tente adivinhar o nome do vegetal respetivo."; } else { instructions.text = "Click on each image and try to guess the name of the respective vegetable."; } if (status.ingredients ["ABÓBORA"] == 1) { abobora.gameObject.transform.GetChild(0).gameObject.SetActive(true); } if (status.ingredients ["BATATAS"] == 1) { batata.gameObject.transform.GetChild(0).gameObject.SetActive(true); } if (status.ingredients ["BERINGELA"] == 1) { beringela.gameObject.transform.GetChild(0).gameObject.SetActive(true); } if (status.ingredients ["BETERRABA"] == 1) { beterraba.gameObject.transform.GetChild(0).gameObject.SetActive(true); } if (status.ingredients ["BRÓCOLOS"] == 1) { brocolos.gameObject.transform.GetChild(0).gameObject.SetActive(true); } if (status.ingredients ["CEBOLA"] == 1) { cebola.gameObject.transform.GetChild(0).gameObject.SetActive(true); } if (status.ingredients ["CENOURA"] == 1) { cenoura.gameObject.transform.GetChild(0).gameObject.SetActive(true); } if (status.ingredients ["COURGETTE"] == 1) { courgette.gameObject.transform.GetChild(0).gameObject.SetActive(true); } if (status.ingredients ["COUVE"] == 1) { couve.gameObject.transform.GetChild(0).gameObject.SetActive(true); } if (status.ingredients ["ERVILHAS"] == 1) { ervilhas.gameObject.transform.GetChild(0).gameObject.SetActive(true); } if (status.ingredients ["ESPARGOS"] == 1) { espargos.gameObject.transform.GetChild(0).gameObject.SetActive(true); } if (status.ingredients ["MILHO"] == 1) { milho.gameObject.transform.GetChild(0).gameObject.SetActive(true); } if (status.ingredients ["PEPINO"] == 1) { pepino.gameObject.transform.GetChild(0).gameObject.SetActive(true); } if (status.ingredients ["PIMENTO"] == 1) { pimento.gameObject.transform.GetChild(0).gameObject.SetActive(true); } if (status.ingredients ["RABANETE"] == 1) { rabanete.gameObject.transform.GetChild(0).gameObject.SetActive(true); } if (status.ingredients ["TOMATE"] == 1) { tomate.gameObject.transform.GetChild(0).gameObject.SetActive(true); } }