public override void OnReleased()
        {
            base.OnReleased();

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

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

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

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

            if (_container != null)
            {
                Object.Destroy(_container);
                _container = null;
            }
        }
        public override void OnInstallingContent()
        {
            _container = new GameObject(REX_OBJECT_NAME);

            var tinyZoneBlockCreators = new[]
            {
                Alley2LBuilder.NAME,
                Oneway1LBuilder.NAME,
                Oneway1LParkingBuilder.NAME,
                Oneway1LBicycleBuilder.NAME,
                ZonablePedestrianTinyGravelRoadBuilder.NAME,
                ZonablePedestrianTinyPavedRoadBuilder.NAME,
                ZonablePedestrianTinyStoneRoadBuilder.NAME,
                ZonablePedestrianTinyBoardwalkBuilder.NAME
            };

            foreach (var name in tinyZoneBlockCreators)
            {
                RoadZoneBlocksCreationManager.RegisterCustomCreator <TinyRoadZoneBlocksCreator>(name);
                RoadSnappingModeManager.RegisterCustomSnapping <TinyRoadSnappingMode>(name);
            }

            _menuInstaller      = _container.AddInstallerComponent <MenuInstaller>();
            _menuInstaller.Host = this;

            _roadsInstaller      = _container.AddInstallerComponent <RoadsInstaller>();
            _roadsInstaller.Host = this;
        }
        public override void OnInstallingContent()
        {
            _container = new GameObject(REX_OBJECT_NAME);

            var tinyZoneBlockCreators = new []
            {
                Alley2LBuilder.NAME,
                OneWay1LBuilder.NAME,
                ZonablePedestrianTinyGravelRoadBuilder.NAME,
                ZonablePedestrianTinyPavedRoadBuilder.NAME,
                ZonablePedestrianTinyStoneRoadBuilder.NAME
            };

            foreach (var name in tinyZoneBlockCreators)
            {
                RoadZoneBlocksCreationManager.RegisterCustomCreator<TinyRoadZoneBlocksCreator>(name);
                RoadSnappingModeManager.RegisterCustomSnapping<TinyRoadSnappingMode>(name);
            }

            _menuInstaller = _container.AddInstallerComponent<MenuInstaller>();
            _menuInstaller.Host = this;

            _roadsInstaller = _container.AddInstallerComponent<RoadsInstaller>();
            _roadsInstaller.Host = this;
        }
Exemplo n.º 4
0
 private void RoadsInstallationCompleted()
 {
     Loading.QueueAction(() =>
     {
         if (_roadsInstaller != null)
         {
             _roadsInstaller.NewRoads = null;
             Object.Destroy(_roadsInstaller);
             _roadsInstaller = null;
         }
     });
 }
Exemplo n.º 5
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;
        }
Exemplo n.º 6
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;
                }
            });
        }
        public override void OnReleased()
        {
            base.OnReleased();

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

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

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

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

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