示例#1
0
        // 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();
            }
        }
 // 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();
     }
 }
示例#3
0
        /// <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
        }
示例#4
0
        /// <summary>
        ///     Shutdown epic services.
        /// </summary>
        public void OnDestroy()
        {
            if (_enableDebugLogs)
            {
                DebugLogger.RegularDebugLog("[EpicManager] - Releasing epic resources and shutting down epic services.");
            }

            if (Application.isEditor)
            {
                LogoutOptions logoutOptions =
                    new LogoutOptions {
                    LocalUserId = AccountId.EpicAccountId
                };

                // Callback might not be called since we call Logout in OnDestroy()
                AuthInterface.Logout(logoutOptions, null, OnAuthInterfaceLogout);
            }
            else
            {
                Platform.Release();
                Platform = null;
                PlatformInterface.Shutdown();
            }
        }
示例#5
0
        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
        }