// When you release and shutdown the SDK library, you cannot initialize it again. // Make sure this is done at a relevant time in your game's lifecycle. // If you are working in editor, it is advised you do not release and shutdown the SDK // as you would be required to restart Unity to initialize the SDK again. private void OnDestroy() { if (EOS == null) { return; } if (Application.isEditor) { if (autoLogoutInEditor) { Epic.OnlineServices.Auth.LogoutOptions logoutOptions = new Epic.OnlineServices.Auth.LogoutOptions(); logoutOptions.LocalUserId = LocalUserAccountId; // Callback might not be called since we call Logout in OnDestroy() EOS.GetAuthInterface().Logout(logoutOptions, null, OnAuthInterfaceLogout); } } else { EOS.Release(); EOS = null; PlatformInterface.Shutdown(); } }
/// <summary> /// On Quit /// </summary> void OnApplicationQuit() { // * Does not work properly in Unity Editor. #if !UNITY_EDITOR m_platformInterface?.Release(); m_platformInterface = null; PlatformInterface.Shutdown(); #endif }
// When you release and shutdown the SDK library, you cannot initialize it again. // Make sure this is done at a relevant time in your game's lifecycle. // If you are working in editor, it is advised you do not release and shutdown the SDK // as you would be required to restart Unity to initialize the SDK again. private void OnDestroy() { if (!Application.isEditor && EOS != null) { EOS.Release(); EOS = null; PlatformInterface.Shutdown(); } }
private void OnApplicationQuit() { if (EOS != null) { EOS.Release(); EOS = null; PlatformInterface.Shutdown(); } // Unhook the library in the editor, this makes it possible to load the library again after stopping to play #if UNITY_EDITOR if (libraryPointer != IntPtr.Zero) { Bindings.Unhook(); // Free until the module ref count is 0 while (FreeLibrary(libraryPointer) != 0) { } libraryPointer = IntPtr.Zero; } #endif }