// called in editor, opens wizard for initial setup, keeps scene PhotonViews up to date and closes connections when compiling (to avoid issues)
    private static void EditorUpdate()
    {
        if (PhotonNetworkManager.PhotonServerSettings == null)
        {
            PhotonNetworkManager.CreateSettings();
        }
        if (PhotonNetworkManager.PhotonServerSettings == null)
        {
            return;
        }

        // serverSetting is null when the file gets deleted. otherwise, the wizard should only run once and only if hosting option is not (yet) set
        if (!PhotonNetworkManager.PhotonServerSettings.DisableAutoOpenWizard && PhotonNetworkManager.PhotonServerSettings.HostType == ServerSettings.HostingOption.NotSet)
        {
            ShowRegistrationWizard();
            PhotonNetworkManager.PhotonServerSettings.DisableAutoOpenWizard = true;
            PhotonEditor.SaveSettings();
        }

        // Workaround for TCP crash. Plus this surpresses any other recompile errors.
        if (EditorApplication.isCompiling)
        {
            if (PhotonNetworkManager.connected)
            {
                if (lastWarning > EditorApplication.timeSinceStartup - 3)
                {
                    // Prevent error spam
                    Debug.LogWarning(CurrentLang.WarningPhotonDisconnect);
                    lastWarning = EditorApplication.timeSinceStartup;
                }

                PhotonNetworkManager.Disconnect();
            }
        }
    }