But more importantly, it allows you to easily register, unregister and get instances yourself!
Below is an example of registering and unregistering the instance, as well as the instances being used from static methods. Mind that you can also get the instances from other scripts, whether they are MonoBehaviour or not.
publicclassGameManager:NetworkBehaviour{privatevoidAwake() { //We register the GameManager instanceInstanceHandler.RegisterInstance(this); }privatevoidOnDestroy() { //Upon being destroyed, we unregister the game manager instanceInstanceHandler.UnregisterInstance<GameManager>(); }privatestaticvoidGetInstanceExample() { //This will fail if the manager isn't registeredInstanceHandler.GetInstance<GameManager>().Success(); }privatestaticvoidTryGetInstanceExample() { //This will only run if we get the manager. Potentially invert the if statement and log and error if you don't get itif(InstanceHandler.TryGetInstance(outGameManager manager))manager.Success(); }privatevoidSuccess() {Debug.Log("Now we're logging from the GameManager instance!",this); }}