Added Handcart case to bogie alignment.
Cleaned up some code.
About the cars getting unloaded. I don't actually know how it works.
I believe DV will force unload an asset bundle it believes unused with unloadAllLoadedObjects set to true as a resource saving measure. This would cause all already loaded models, textures, etc, from a car to get force unloaded. So instead of allowing the game to unload the bundle, we unload it first ourselves with that parameter set to false.
As such, the game will not find a bundle to unload, and the assets we loaded will stay.
In addition to this, I believe this opens the possibility of hotreloading in the future, as we can load the same asset bundle again.
However, I have no knowledge on this matter, and this was just a lucky guess.
Added Handcart case to bogie alignment. Cleaned up some code.
About the cars getting unloaded. I don't actually know how it works. I believe DV will force unload an asset bundle it believes unused with
unloadAllLoadedObjects
set to true as a resource saving measure. This would cause all already loaded models, textures, etc, from a car to get force unloaded. So instead of allowing the game to unload the bundle, we unload it first ourselves with that parameter set to false. As such, the game will not find a bundle to unload, and the assets we loaded will stay. In addition to this, I believe this opens the possibility of hotreloading in the future, as we can load the same asset bundle again. However, I have no knowledge on this matter, and this was just a lucky guess.