Example #1
0
        private void Deinit()
        {
            LoadPassengersPatch.Undo();
            UnloadPassengersPatch.Undo();
            DepotAIPatch.Undo();
            NetManagerPatch.Undo();
            VehicleManagerPatch.Undo();
            PublicTransportLineVehicleModelSelectorRefreshPatch.Undo();

            Redirector <TramAIDetour> .Revert();

            Redirector <PassengerTrainAIDetour> .Revert();

            Redirector <PassengerShipAIDetour> .Revert();

            Redirector <PassengerPlaneAIDetour> .Revert();

            Redirector <PassengerFerryAIDetour> .Revert();

            Redirector <PassengerBlimpAIDetour> .Revert();

            Redirector <BusAIDetour> .Revert();

            Redirector <CommonBuildingAIReverseDetour> .Revert();

            Redirector <PublicTransportStopButtonDetour> .Revert();

            Redirector <PublicTransportVehicleButtonDetour> .Revert();

            Redirector <PublicTransportWorldInfoPanelDetour> .Revert();

            Redirector <TrolleybusAIDetour> .Revert();

            Redirector <PassengerHelicopterAIDetour> .Revert();

            Redirector <TransportLineDetour> .Revert();

            TransportLineSimulationStepPatch.Undo();
            TransportLineGetLineVehiclePatch.Undo();
            CachedTransportLineData.Deinit();

            BuildingExtension.Deinit();
            CachedNodeData.Deinit();
            CachedVehicleData.Deinit();
            VehiclePrefabs.Deinit();
            SerializableDataExtension.instance.Loaded = false;
            LocaleModifier.Deinit();

            if ((UnityEngine.Object) this._iptGameObject != (UnityEngine.Object)null)
            {
                UnityEngine.Object.Destroy((UnityEngine.Object) this._iptGameObject);
            }
            if (!((UnityEngine.Object) this._worldInfoPanel != (UnityEngine.Object)null))
            {
                return;
            }
            UnityEngine.Object.Destroy((UnityEngine.Object) this._worldInfoPanel);
        }
        private void Deinit()
        {
            HarmonyInstance?.UnpatchAll();
            Redirector <TramAIDetour> .Revert();

            Redirector <PassengerTrainAIDetour> .Revert();

            Redirector <PassengerShipAIDetour> .Revert();

            Redirector <PassengerPlaneAIDetour> .Revert();

            Redirector <PassengerFerryAIDetour> .Revert();

            Redirector <PassengerBlimpAIDetour> .Revert();

            Redirector <BusAIDetour> .Revert();

            Redirector <CommonBuildingAIReverseDetour> .Revert();

            Redirector <PublicTransportStopButtonDetour> .Revert();

            Redirector <PublicTransportVehicleButtonDetour> .Revert();

            Redirector <PublicTransportWorldInfoPanelDetour> .Revert();

            Redirector <TrolleybusAIDetour> .Revert();

            Redirector <PassengerHelicopterAIDetour> .Revert();

            Redirector <TransportLineDetour> .Revert();

            CachedTransportLineData.Deinit();

            BuildingExtension.Deinit();
            CachedNodeData.Deinit();
            CachedVehicleData.Deinit();
            VehiclePrefabs.Deinit();
            SerializableDataExtension.instance.Loaded = false;
            LocaleModifier.Deinit();

            if ((UnityEngine.Object) this._iptGameObject != (UnityEngine.Object)null)
            {
                UnityEngine.Object.Destroy((UnityEngine.Object) this._iptGameObject);
            }
            if (!((UnityEngine.Object) this._worldInfoPanel != (UnityEngine.Object)null))
            {
                return;
            }
            UnityEngine.Object.Destroy((UnityEngine.Object) this._worldInfoPanel);
        }