// Disabling public override void OnSphereInactive() { // Don't update, if the Injector is still running if (!isLoaded) { return; } // Enable the maps if (OnDemandStorage.DisableBody(sphere.name)) { isLoaded = false; Debug.Log("[OD] Disabling Body " + base.sphere.name + ": " + isLoaded); } }
void LateUpdate() { // If we aren't loaded or we're not wanting to unload then do nothing if (!isLoaded || unloadTime == 0) { return; } // If we're past the unload time then unload if (System.Diagnostics.Stopwatch.GetTimestamp() > unloadTime) { // Disable the maps if (OnDemandStorage.DisableBody(sphere.name)) { Debug.Log("[OD] Disabling Body " + base.sphere.name + ": " + isLoaded); } isLoaded = false; } }