-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #59: Disable OrbitRenderer and MapObjects when not in map mode/tracking station #60
Fix #59: Disable OrbitRenderer and MapObjects when not in map mode/tracking station #60
Conversation
I don't like how this is implemented. You never know what random plugin X is doing, so I'm always trying to minimize any behavior difference versus stock. Calling LateUpdate from GameEvents callbacks will result in incorrect behavior. It probably doesn't cause obvious issues, but I prefer to avoid altering stock behavior when possible, especially when inducing subtle changes like that. Enabling/disabling components is also risky if anything else is relying on that. I would suggest using a pooling approach with I'm a bit more inclined to allow disabling MapObjects, but I would suggest disabling the GameObject instead of the component. As a general rule, when altering stock behavior, never rely on GameEvents. You have absolutely no control on the call order of GE delegates, and it is usually better to restore the expected stock state before the stock method firing the GE even starts. Will poke at implementing all that, letting this open for now. |
Mmmh. Disabling |
Yes, my first attempt deactivated the gameobjects but quickly (well not that quickly) realized that there were other components on those objects that need to run. |
What I mean is that |
Er, this change doesn't disable all MapObjects - only the ones that represent the icons owned by OrbitRenderer. There are 5 of those per OrbitRenderer. I'm seeing ~1.5ms in MapObject.LateUpdate in the profiler with about 1200 objects (bodies + vessels). The count per frame is about 6400. |
Again, one of those 5 MapObjects ( Said otherwise, you can't avoid the And side note, the map objects aren't "owned" by OrbitRenderer, they are in fact are in completely different GameObject hierarchies and "managed" by different components depending on the current scene. It's quite messy. |
No description provided.