Exemple #1
0
 public void ReturnToMenu()
 {
     if (playerScore >= threshold || dataController.Get_attempt() == 3)
     {
         if (dataController.Get_attempt() != 3)
         {
             FindObjectOfType <Bars>().DealEtudePlus(playerScore / 4); // ?? A VOIR ^^
         }
         Destroy(GameObject.Find("DataController"));
         alreadytook.Clear();
         SceneManager.UnloadSceneAsync("Menu_quizz");
         if (save.Get_counter() != 4)
         {
             save.Disp_after_Stop("Quizz");
         }
         else
         {
             SectionDisplay.gameObject.SetActive(true);
         }
     }
     else
     {
         SceneManager.UnloadSceneAsync("Quizz");
     }
 }
Exemple #2
0
 void Start()
 {
     isRunning    = false;
     pathname     = "j1_1";
     path_counter = 1;
     save         = FindObjectOfType <Sauvegarde>();
     save.Find_dice();
     advance = save.Get_counter();
     if (advance != 0)
     {
         Play_iTween(this.gameObject);
         Sauvegarde.dices.gameObject.SetActive(false);
     }
 }
Exemple #3
0
    public void OnTriggerEnter(Collider other)
    {
        Movement.flag = false;
        if (!was_triggered)
        {
            was_triggered = true;

            if (Movement.advance == 0) //si il n'y a pas de sauvegarde
            {
                if (save.Get_nextmove() != 0)
                {
                    save.Set_counter(save.Get_counter() + 1);
                    save.Set_nextmove(save.Get_nextmove() - 1);
                }

                if (this.name.Length >= 10)
                {
                    Movement.path_counter += 1;

                    if (this.intersection == 1)     //Movement.pathname = "J1_" + Movement.path_counter + "_LEFT";
                    {
                        if (this.name.Equals("P6_ENDPATH") && save.Get_counter() == 52)
                        {
                            Move_counter();
                        }
                        if (save.Get_nextmove() != 0)     // si il reste des cases à bouger
                        {
                            //Debug.Log("case n° " + save.Get_counter());
                            if (save.Get_counter() != 46)     // si ce n'est pas la case immersion
                            {
                                StartCoroutine(Choice());
                            }
                            else
                            {
                                if (save.Get_imm())
                                {
                                    Movement.pathname = "J1_" + Movement.path_counter + "_LEFT";
                                }
                                else
                                {
                                    Movement.pathname = "J1_" + Movement.path_counter + "_RIGHT";
                                    Move_counter();
                                }

                                Movement.Play_iTween(GameObject.Find("Sphere_path"));
                            }
                        }
                        else
                        {
                            iTween.Pause();
                        }
                    }
                    else
                    {
                        Movement.pathname = "J1_" + Movement.path_counter;

                        if (save.Get_nextmove() != 0)
                        {
                            Movement.Play_iTween(GameObject.Find("Sphere_path"));
                        }
                        else
                        {
                            Movement.flag = true;
                        }

                        Move_counter();
                    }
                }

                if (save.Get_nextmove() == 0 || save.Get_counter() == 100) /// Avance until the dice number
                {
                    iTween.Pause();
                    StartCoroutine(Action_Case(0.8f)); //lancer l'action de la case
                }
                else if (IsStop())
                {
                    iTween.Pause();
                    StartCoroutine(Action_Case(0.8f));
                }
            }
            else // sauvegarde présente
            {
                if (Movement.advance == 100)
                {
                    SceneManager.LoadScene("End Game");
                }

                Movement.advance--;
                Movement.j++;
                if (Movement.advance == 0)
                {
                    iTween.Pause(); Sauvegarde.dices.gameObject.SetActive(true);
                }

                else
                {
                    if (this.name.Length >= 10) // ex : P1_ENDPATH
                    {
                        Movement.path_counter += 1;
                        if (this.intersection == 1)
                        {
                            if (this.name.Equals("P6_ENDPATH") && Movement.advance == 52)
                            {
                                Move_advance();
                            }
                            if (Isleft(save.Get_counter()))
                            {
                                Movement.pathname = "J1_" + Movement.path_counter + "_LEFT";
                            }
                            else
                            {
                                Movement.pathname = "J1_" + Movement.path_counter + "_RIGHT";
                                Move_advance();
                            }
                        }

                        else
                        {
                            Movement.pathname = "J1_" + Movement.path_counter;
                            Move_advance();
                        }

                        Movement.Play_iTween(other.gameObject);
                    }
                }
            }
        }
    }
Exemple #4
0
    public void Start()
    {
        save = FindObjectOfType <Sauvegarde>();

        if (save.Get_counter() == 24 || save.Get_counter() == 84)
        {
            Titletext.text = "Projet Voltaire";
            Rulestext.text = "Une phrase est affichée.\n Répondez VRAI si elle ne contient PAS de faute.\n Répondez FAUX si elle contient une faute.";
        }
        else if (save.Get_counter() == 91)
        {
            Titletext.text = "TOEIC";
            Rulestext.text = "A sentence is displayed.\n Answer TRUE if it does NOT contains a fault.\n Answer FALSE if it contains a fault.";
        }
        else
        {
            if (save.Get_counter() == 4)
            {
                Titletext.text = "Concours Puissance Alpha";
            }
            else if (save.Get_counter() == 19)
            {
                Titletext.text = "CE L1";
            }
            else if (save.Get_counter() == 34)
            {
                Titletext.text = "DE L1";
            }
            else if (save.Get_counter() == 45)
            {
                Titletext.text = "DE L2";
            }
            else if (save.Get_counter() == 51)
            {
                Titletext.text = "CE L3";
            }
            else if (save.Get_counter() == 54)
            {
                Titletext.text = "CE L3";
            }
            else if (save.Get_counter() == 63)
            {
                Titletext.text = "DE L3";
            }
            else if (save.Get_counter() == 79)
            {
                Titletext.text = "DE M1";
            }
            else if (save.Get_counter() == 98)
            {
                Titletext.text = "DE M2";
            }

            if (save.Get_langue() == 0)
            {
                Rulestext.text = "Une affirmation vous est affichée.\n Dites si elle est VRAI ou FAUSSE.";
            }
            else
            {
                Rulestext.text = "An affirmation is shown.\n Indicate if it is TRUE or FALSE.";
            }
        }
    }
Exemple #5
0
    void Start()
    {
        save = FindObjectOfType <Sauvegarde>();


        switch (save.Get_counter())
        {
        case 4:
            filename = "data_concours.txt";
            break;

        case 19:
            if (save.Get_langue() == 0)
            {
                filename = "data_L1.txt";
            }
            else
            {
                filename = "data_L1_E.txt";
            }
            break;

        case 24:
            filename = "Projet_Voltaire.txt";
            break;

        case 34:
            if (save.Get_langue() == 0)
            {
                filename = "data_L1.txt";
            }
            else
            {
                filename = "data_L1_E.txt";
            }
            break;

        case 45:
            if (save.Get_langue() == 0)
            {
                filename = "data_L2.txt";
            }
            else
            {
                filename = "data_L2_E.txt";
            }
            break;

        case 51:
            if (save.Get_langue() == 0)
            {
                filename = "data_L3.txt";
            }
            else
            {
                filename = "data_L3_E.txt";
            }
            break;

        case 54:
            if (save.Get_langue() == 0)
            {
                filename = "data_L3.txt";
            }
            else
            {
                filename = "data_L3_E.txt";
            }
            break;


        case 63:
            if (save.Get_langue() == 0)
            {
                filename = "data_L3.txt";
            }
            else
            {
                filename = "data_L3_E.txt";
            }
            break;

        case 79:
            if (save.Get_langue() == 0)
            {
                filename = "data_M1.txt";
            }
            else
            {
                filename = "data_M1_E.txt";
            }
            break;

        case 84:
            filename = "Projet_Voltaire.txt";
            break;

        case 91:
            filename = "TOEIC.txt";
            break;

        case 98:
            if (save.Get_langue() == 0)
            {
                filename = "data_M2.txt";
            }
            else
            {
                filename = "data_M2_E.txt";
            }
            break;

        default:
            filename = "data_concours.txt";
            break;
        }
    }