Esempio n. 1
0
        public override void OnReleased()
        {
            base.OnReleased();

            if (_isReleased)
            {
                return;
            }

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

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

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

            _isReleased = true;
        }
        public override void OnReleased()
        {
            base.OnReleased();

            if (_isReleased)
            {
                return;
            }

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

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

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

            _isReleased = true;
        }
Esempio n. 3
0
 private void InitializationCompleted(object sender, EventArgs e)
 {
     Loading.QueueAction(() =>
     {
         if (_initalizer != null)
         {
             _initalizer.NewRoads = null;
             Object.Destroy(_initalizer);
             _initalizer = null;
         }
     });
 }
 private void InitializationCompleted(object sender, EventArgs e)
 {
     Loading.QueueAction(() =>
     {
         if (_initalizer != null)
         {
             _initalizer.NewRoads = null;
             Object.Destroy(_initalizer);
             _initalizer = null;
         }
     });
 }
Esempio n. 5
0
        public override void OnCreated(ILoading loading)
        {
            base.OnCreated(loading);

            if (_isReleased)
            {
                _container = new GameObject(NEXT_OBJECT_NAME);

                _newRoads      = _container.AddComponent <NetCollection>();
                _newRoads.name = NEWROADS_NETCOLLECTION;

                _initalizer          = _container.AddComponent <ModInitializer>();
                _initalizer.NewRoads = _newRoads;
                _initalizer.InitializationCompleted += InitializationCompleted;

                _isReleased = false;
            }
        }
        public override void OnCreated(ILoading loading)
        {
            base.OnCreated(loading);

            if (_isReleased)
            {
                _container = new GameObject(NEXT_OBJECT_NAME);

                _newRoads = _container.AddComponent<NetCollection>();
                _newRoads.name = NEWROADS_NETCOLLECTION;

                _initalizer = _container.AddComponent<ModInitializer>();
                _initalizer.NewRoads = _newRoads;
                _initalizer.InitializationCompleted += InitializationCompleted;

                _isReleased = false;
            }
        }