void CheckGameOver() { if (!finished && ressourceManager.get((int)Ressources.Money) < 0) { Debug.Log("Oh no :("); finished = true; LooseScreen.gameObject.SetActive(true); Time.timeScale = 0; } if (!finished && ressourceManager.get((int)Ressources.Money) >= 1000000 || jobManager.PopulationNumber() + jobManager.NonWorkerNumber() >= 1000) { Debug.Log("gg!"); WinScreen.gameObject.SetActive(true); finished = true; Time.timeScale = 0; } }
// Update is called once per frame void Update() { string discreteItem = "{0:,0}"; Money.text = string.Format("{0:#,##0.00}", ressourceManager.get((int)Ressources.Money)); Fish.text = string.Format(discreteItem, ressourceManager.get((int)Ressources.Fish)); Planks.text = string.Format(discreteItem, ressourceManager.get((int)Ressources.Planks)); Wood.text = string.Format(discreteItem, ressourceManager.get((int)Ressources.Wood)); Wool.text = string.Format(discreteItem, ressourceManager.get((int)Ressources.Wool)); Cloth.text = string.Format(discreteItem, ressourceManager.get((int)Ressources.Cloth)); Potato.text = string.Format(discreteItem, ressourceManager.get((int)Ressources.Potato)); Schnapps.text = string.Format(discreteItem, ressourceManager.get((int)Ressources.Schnapps)); Population.text = string.Format("{0:,0}+{1:,0} ({2:,0} free)", jobManager.PopulationNumber(), jobManager.NonWorkerNumber(), jobManager.freeWorkers()); }