Пример #1
0
        private void Awake()
        {
            _plants           = new List <PlantLifecycle>();
            _plantPool        = new ObjectPool(_plantPrefab, _poolSize, transform, GetLifecycleHandle);
            _playingFieldGrid = FindObjectOfType <PlayingFieldGrid>();
            _plantHealthMeter = _plantHealthMeterGameObject.GetComponent <MeterDisplay>();

            FindObjectOfType <GameController>().RegisterScriptToSuspendWhenGameEnds(this);
        }
Пример #2
0
        private void Awake()
        {
            _particles       = GetComponent <ParticleSystem>();
            _smogHealthMeter = _smogDensityMeterGameObject.GetComponent <MeterDisplay>();

            changeRateModifiers = new List <ISmogDensityChangeModifier>();

            FindObjectOfType <GameController>().RegisterScriptToSuspendWhenGameEnds(this);
        }