Example #1
0
    public void ContinueToPlay()
    {
        disableRevolutionEnd = true;
        ContinueButton.gameObject.SetActive(false);
        reviewButton.gameObject.SetActive(true);
        // restart all systems
        foreach (FSystem sys in FSystemManager.updateSystems())
        {
            sys.Pause = false;
        }

        // Forcer le bouton en pause
        PauseButton.isOn = false;
        PauseButton.isOn = true;

        this.enabled = true;
        transform.GetChild(0).GetComponent <Animator>().Play("ContinueToPlay");
        Invoke("DisableChild", 0.25f); // Après que l'animation soit terminée, il faut désactiver le fils pour qu'il soit proprement réactivé lors de la fin du jeu

        if (music)
        {
            music.clip = defaultTheme;
            music.Play();
        }
    }
Example #2
0
 // Use to process your families.
 protected override void onProcess(int familiesUpdateCount)
 {
     if (Input.GetMouseButtonDown(0) && exit_GO.GetComponent <PointerOver>() != null)
     {
         ComponentMonitoring monitor = exit_GO.GetComponent <ComponentMonitoring> ();
         // Check if hero is near to exit (only hero can produce this component thanks to Unity Physics layers)
         Triggered3D triggered = exit_GO.GetComponent <Triggered3D> ();
         if (triggered != null)
         {
             MonitoringManager.trace(monitor, "perform", MonitoringManager.Source.PLAYER);
             GameObjectManager.setGameObjectState(endScreen_GO, true);
             foreach (FSystem sys in FSystemManager.fixedUpdateSystems())
             {
                 sys.Pause = true;
             }
             foreach (FSystem sys in FSystemManager.lateUpdateSystems())
             {
                 sys.Pause = true;
             }
             foreach (FSystem sys in FSystemManager.updateSystems())
             {
                 sys.Pause = true;
             }
         }
     }
 }
Example #3
0
    private void displayEnd()
    {
        nbDeadText  = countryPopData.nbDeath.ToString("N0", CultureInfo.CreateSpecificCulture("fr-FR"));
        nbDead.text = baseNbDeadText + nbDeadText;
        float debtValue   = finances.historySpent[finances.historySpent.Count - 1];
        int   nbMilliards = (int)(debtValue / 1000000000);

        if (nbMilliards > 0)
        {
            debtText = nbMilliards.ToString("N0", CultureInfo.CreateSpecificCulture("fr-FR")) + " Milliard" + (nbMilliards > 1 ? "s" : "") + " d'euros";
        }
        else
        {
            int nbMillions = (int)(debtValue / 1000000);
            if (nbMillions > 0)
            {
                debtText = nbMillions.ToString("N0", CultureInfo.CreateSpecificCulture("fr-FR")) + " Million" + (nbMillions > 1 ? "s" : "") + " d'euros";
            }
            else
            {
                debtText = debtValue.ToString("N0", CultureInfo.CreateSpecificCulture("fr-FR")) + " euros";
            }
        }
        debt.text = baseDebtText + debtText;

        daysText = "";
        int nbYears  = time.daysGone / 365;
        int nbMonths = (time.daysGone % 365) / 30;
        int nbDays   = (time.daysGone % 365) % 30;

        if (nbYears > 0)
        {
            daysText += nbYears.ToString("N0", CultureInfo.CreateSpecificCulture("fr-FR")) + " an" + (nbYears > 1 ? "s " : " ");
        }
        if (nbMonths > 0)
        {
            daysText += nbMonths + " mois ";
        }
        if (nbDays > 0)
        {
            daysText += nbDays + " jour" + (nbDays > 1 ? "s " : " ");
        }
        days.text = baseDaysText + daysText;

        // stopper tous les systèmes
        foreach (FSystem sys in FSystemManager.updateSystems())
        {
            if (sys != BarsSystem.instance && sys != CurvesSystem.instance)
            {
                sys.Pause = true;
            }
        }
        this.enabled = false;
    }