IEnumerator Update_Jeton() { yield return(new WaitForSeconds(2)); if (save.Get_jetons() != 0) { save.Set_jetons(save.Get_jetons() - 1); if (save.Get_langue() == 0) { jet_text_1.text = "Il vous en reste : " + save.Get_jetons(); } else { jet_text_1.text = "You have " + save.Get_jetons() + " left."; } jet_text_2.text = Random_aug(); jet_text_2.color = Nice_color(); } if (save.Get_jetons() != 0) // s'il reste des jetons { StartCoroutine(Update_Jeton()); } else { jet_btn.gameObject.SetActive(true); Display_Dip(); } }
void Start() { save = FindObjectOfType <Sauvegarde>(); bars = FindObjectOfType <Bars>(); jet = save.Get_jetons(); if (save.Get_langue() == 0) { diplome_Titre.text = "Ton Diplome : "; diplome_text.text = "Name : " + save.Get_player() + "\nSection : " + save.Get_section() + "\nMajeure : " + save.Get_majeure() + "\nTa destination : " + save.Get_destination() + "\nTes associations : \n" + Get_sub_assos(); if (save.Get_bde()) { diplome_text.text = diplome_text.text + "Tu as fais partie du BDE\n"; } //job_titre.text = "Les métiers qui te correspondent sont : "; //job_text.text = "A completer !! :D"; menu_btn.text = "Retourner au Menu"; jet_title.text = "Vous avez gagné " + jet + " jetons !"; jet_text_1.text = "Il vous en reste : " + save.Get_jetons(); StartCoroutine(Update_Jeton()); } else { diplome_Titre.text = "Your Diploma : "; diplome_text.text = "Section : " + save.Get_section() + "\nMajeure : " + save.Get_majeure() + "\nYour destination : " + save.Get_destination() + "\nYour associations : \n" + Get_sub_assos(); if (save.Get_bde()) { diplome_text.text = diplome_text.text + "\nYou've been a part of the Student Association.\n"; } job_titre.text = "Jobs that would fit you : "; job_text.text = "A completer !! :D"; menu_btn.text = " Go to the Main Menu"; jet_title.text = "You have earned " + jet + " chips !"; jet_text_1.text = "You have " + save.Get_jetons() + " left."; StartCoroutine(Update_Jeton()); } }