Closed Rodg88 closed 1 year ago
Thank you. Kindly read contributiing.md, code_of_conduct.md and styleguide.md. These are boilerplate.
thank you to @lisias
Apparently, something is being loaded using Unity's Serialization on the MonoBehaviour constructor, and this breaks the Unity's life cicle.
All the NREs are happening, probably, because that Object was not loaded.
Move the code to the Awake callback, it should fix this problem - but you will need to be sure that anything using that object being loaded is not called before the Awake itself.
I think the culprit is this line:
Try to replace that code with:
private GameObject m_WindowPrefab;
internal void Awake()
{
m_WindowPrefab = PreciseManeuverConfig.Instance.Prefabs.LoadAsset<GameObject> ("PreciseManeuverWindow");
}
The thingy is private, so no other object access it, and I didn't found anyone trying to use it before the Awake event is called!
@Rodg88 thank you - and @lisias - it seems to have fixed the issue.
Brief description of your issue
Ive set up a instance of KSP in debug mode to use the unity profiler, and on loading it gives this error:
and I'm also getting constant NREs from this mod in flight, and the window doesn't show up. First this error shows in the log
than this repeats
Player log here: (game wasn't exited) https://cdn.discordapp.com/attachments/966275238851653732/997942712038867034/Player_-_Copy.zip
Steps to reproduce
Launched the game after following this guide for getting debug mode and the unity profiler https://gist.github.com/gotmachine/d973adcb9ae413386291170fa346d043
Expected behavior
The in game window to show up after making a node
Actual behavior
NRE spam in the log
Environment
How did you download and install this?
SpaceDock (manual install)