Exemple #1
0
 public void Init()
 {
     day = Memory.Instance.GetDay();
     engueule = Memory.Instance.GetEngueule();
     if (day == 1)
     {
         firstDay = gameObject.GetComponent<FirstDay>();
         firstDay.PlayDay();
     }
     else if (day == 2)
     {
         statistics = Memory.Instance.GetStatistics();
         statNames = Memory.Instance.GetStatNames();
         secondDay = gameObject.GetComponent<SecondDay>();
     }
     else
     {
         statistics = Memory.Instance.GetStatistics();
         statNames = Memory.Instance.GetStatNames();
         thirdDay = gameObject.GetComponent<ThirdDay>();
     }
 }
Exemple #2
0
    // Update is called once per frame
    void Update()
    {
        if (Memory.Instance != null && !initiated)
        {
            Init();
            initiated = true;
        }

        if (day == 2 && initiated && !sceneRunning)
        {
            sceneRunning = true;
            // First period
            if ((int)statistics[statNames[3]] < -25 && indiceJournee == 0)
                secondDay.Retard();
            else if ((int)statistics[statNames[2]] > 25 && indiceJournee == 0)
                secondDay.Depressif();
            else if ((int)statistics[statNames[1]] > 25 && indiceJournee == 0)
                secondDay.FaireSonLit();
            else if (indiceJournee == 0)
                secondDay.DefaultReveil();

            // Second period
            if ((int)statistics[statNames[0]] > 25 && (int)statistics[statNames[1]] < 25 && indiceJournee == 1)
                secondDay.Engueule();
            else if (indiceJournee == 1)
                secondDay.Travail();

            // Third Period après Engueule
            if (engueule && (int)statistics[statNames[2]] > 25 && indiceJournee == 2)
                secondDay.DormirApresEngueule();
            else if (engueule && indiceJournee == 2)
                secondDay.Vaisselle();

            // Third Period après Travail
            if (!engueule && (int)statistics[statNames[3]] > 25 && indiceJournee == 2)
                secondDay.Endors();
            else if (!engueule && (int)statistics[statNames[1]] > 25 && indiceJournee == 2)
                secondDay.Bisou();
            else if (!engueule && indiceJournee == 2)
                secondDay.Nothing();
        }
        else if (day == 3 && initiated && !sceneRunning)
        {
            sceneRunning = true;
            statistics = Memory.Instance.GetStatistics();
            statNames = Memory.Instance.GetStatNames();
            thirdDay = gameObject.GetComponent<ThirdDay>();

            // First period
            if ((int)statistics[statNames[3]] < -50 && indiceJournee == 0)
                thirdDay.Retard();
            else if (indiceJournee == 0)
                thirdDay.Rien();

            // Second period
            if ((int)statistics[statNames[0]] > 50 && (int)statistics[statNames[1]] < 50 && indiceJournee == 1 && engueule)
                thirdDay.Engueule2();
            else if (indiceJournee == 1)
                thirdDay.Travaille();

            // Third period
            if ((int)statistics[statNames[0]] > 50 && (int)statistics[statNames[1]] < 50 && indiceJournee == 2 && engueule)
                thirdDay.Conquerir();
            else if ((int)statistics[statNames[1]] > 50 && indiceJournee == 2 && !engueule)
                thirdDay.Copine2();
            else if ((int)statistics[statNames[2]] > 50 && indiceJournee == 2)
                thirdDay.Depression();
            else if (indiceJournee == 2)
                thirdDay.Nothing();
        }
    }