Esempio n. 1
0
 /// <summary>
 /// Check timer and change airQuality. Reset timer afterwards.
 /// </summary>
 protected override void Update()
 {
     base.Update();
     timer -= Time.deltaTime;
     if (timer <= 0)
     {
         ChangeAirQuality(airQualityImpact);
         ResetTimer(CountdownTimer.GetCountdownInSec());
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Update is called once per frame.
        /// Check timer and change airQuality. Reset timer afterwards.
        /// Only affects airQuality if tree has water and is able to spend the costs.
        /// </summary>
        protected override void Update()
        {
            base.Update();
            timer -= Time.deltaTime;
            if (timer <= 0)
            {
                if (GetInteractableType() == InteractableType.SPROUT && amountWater >= 1)
                {
                    ChangeAirQuality(airQualityImpactAsSprout);
                }
                else if (GetInteractableType() == InteractableType.TREE && amountWater >= 1)
                {
                    ChangeAirQuality(airQualityImpactAsTree);
                }

                ResetTimer(CountdownTimer.GetCountdownInSec());
            }

            ChangeScaleOfTree();
            DistinguishSproutOrTree();
        }
Esempio n. 3
0
 /// <summary>
 /// Start timer with central CountdownTimer value.
 /// </summary>
 void Start()
 {
     ResetTimer(CountdownTimer.GetCountdownInSec());
     SetInteractableType(InteractableType.SPROUT);
 }
Esempio n. 4
0
        /// <summary>
        /// Start timer with central CountdownTimer value.
        /// Spawns villagers of the house.
        /// </summary>
        void Start()
        {
            ResetTimer(CountdownTimer.GetCountdownInSec());

            SpawnVillagers();
        }