Beispiel #1
0
        private int maxPopulation = 5; //Maximum number of units that can be present at the same time (which can be increased in the game by constructing certain buildings)

        //update the maximum population
        public void UpdateMaxPopulation(int value, bool add = true)
        {
            if (add)
            {
                maxPopulation += value;
            }
            else
            {
                maxPopulation = value;
            }

            //custom event trigger:
            CustomEvents.OnMaxPopulationUpdated(this, value);
        }