So if If I leave a scene with a network manager and it gets destroyed the next time I try to start one up I get: NullReferenceException: Before using the library you should call Init() and do not forget to call Shutdown() afterwards UnityEditor.NetworkDetailStats+NetworkOperationDetails.NewProfilerTick (Int32 tickId) (at C:/buildslave/unity/build/Editor/Mono/Profiler/NetworkDetailStats.cs:118) UnityEditor.NetworkDetailStats.NewProfilerTick (Single newTime) (at C:/buildslave/unity/build/Editor/Mono/Profiler/NetworkDetailStats.cs:209) UnityEngine.Networking.NetworkIdentity.UNetStaticUpdate () (at C:/buildslave/unity/build/Extensions/Networking/Runtime/NetworkIdentity.cs:1095) How can I reset the network system?
Does anyone know, I really need a way top force the network system back to its default starting state.
Are you using LLAPI or HLAPI? Seems by the messages like you are using HLAPI. I guess just before you destroy the NetworkManager. Do NetworkManager.Shutdown();
I am using HLAPI but I do still get a lot of LLAPI errors. I am trying to make it shut down properly but would still like a way to prevent the app from being permanently broken if a scene is exited incorrectly.
If a scene is exited incorrectly? Just make sure to shut it down before exiting the scene? Or even simpler. Never destroy the NetworkManager.
After looking at the HLAPI code StartClient calls NetworkTransport.Init. Does the LLAPI have a get state method so I can see if it needs to be shutdown before it starts?
Not that I know of. But why don't you just Shut it down before the scene is changed? Or never destroy it at all
I will see if calling it in OnDestroy works but for not destroying it on my current project it is in a stage where its a bit late to totally change how scene transitions work.
You don't have to change how transitions work. There is a option on the networkmanager called "DontDestroyOnLoad". Tick it and the NM will remain across scenes.
Untiy has a odd idea of what a singleton is? huh? https://bitbucket.org/Unity-Technol...anager.cs?at=5.3&fileviewer=file-view-default That's the source code for NetworkManager. It destroys the second NetworkManager if one already exists. But only if you have DontDestroyOnLoad
Is there any to to suggest to Unity void Awake() { InitializeSingleton(); } Be changed to: protected virtual void Awake() { InitializeSingleton(); }
You can download the Bitbucket project. Change the sourcecode. Compile it to a DLL. And replace your current one with that one. Further instructions: https://bitbucket.org/Unity-Technologies/networking/overview