Пример #1
0
        private void InitializationCompleted()
        {
            Loading.QueueAction(() =>
            {
                if (_initializer != null)
                {
                    Object.Destroy(_initializer);
                    _initializer = null;
                }

                if (_container != null)
                {
                    _localizationInstaller = _container.AddComponent<LocalizationInstaller>();
                    _localizationInstaller.InstallationCompleted += LocInstallationCompleted;

                    _assetsInstaller = _container.AddComponent<AssetsInstaller>();
                    _assetsInstaller.InstallationCompleted += AssetsInstallationCompleted;

                    _roadsInstaller = _container.AddComponent<RoadsInstaller>();
                    _roadsInstaller.NewRoads = _newRoads;
                    _roadsInstaller.InstallationCompleted += RoadsInstallationCompleted;
                }
            });
        }
Пример #2
0
 private void RoadsInstallationCompleted()
 {
     Loading.QueueAction(() =>
     {
         if (_roadsInstaller != null)
         {
             _roadsInstaller.NewRoads = null;
             Object.Destroy(_roadsInstaller);
             _roadsInstaller = null;
         }
     });
 }
Пример #3
0
        public override void OnReleased()
        {
            base.OnReleased();

            if (_isReleased)
            {
                return;
            }

            if (_initializer != null)
            {
                Object.Destroy(_initializer);
                _initializer = null;
            }

            if (_localizationInstaller != null)
            {
                Object.Destroy(_localizationInstaller);
                _localizationInstaller = null;
            }

            if (_assetsInstaller != null)
            {
                Object.Destroy(_assetsInstaller);
                _assetsInstaller = null;
            }

            if (_roadsInstaller != null)
            {
                Object.Destroy(_roadsInstaller);
                _roadsInstaller = null;
            }

            if (_menusInstaller != null)
            {
                Object.Destroy(_menusInstaller);
                _menusInstaller = null;
            }

            if (_newRoads != null)
            {
                Object.Destroy(_newRoads);
                _newRoads = null;
            }

            if (_container != null)
            {
                Object.Destroy(_container);
                _container = null;
            }

            _isReleased = true;
        }