Ejemplo n.º 1
0
        private static void OnEditorApplicationQuitting()
        {
#if UNITY_2020_1_OR_NEWER
            _isQuitting = true;
#endif

            BurstCompiler.Shutdown();
        }
Ejemplo n.º 2
0
        private static void OnVersionChangeDetected()
        {
            // Write marker file to tell Burst to delete the cache at next startup.
            try
            {
                File.Create(Path.Combine(BurstCompilerOptions.DefaultCacheFolder, BurstCompilerOptions.DeleteCacheMarkerFileName)).Dispose();
            }
            catch (IOException)
            {
                // In the unlikely scenario that two processes are creating this marker file at the same time,
                // and one of them fails, do nothing because the other one has hopefully succeeded.
            }

            EditorUtility.DisplayDialog("Burst Package Update Detected", "The version of Burst used by your project has changed. Please restart the Editor to continue.", "OK");
            BurstCompiler.Shutdown();
        }
Ejemplo n.º 3
0
        private static void ChangeOptionSafely(Action callback)
        {
            try
            {
                RequiresRestartUtility.CalledFromUI = true;

                callback();

                if (RequiresRestartUtility.RequiresRestart)
                {
                    EditorUtility.DisplayDialog(
                        "Editor Restart Required",
                        "This setting will not be applied until the Editor has been restarted. Please restart the Editor to continue.",
                        "OK");
                    BurstCompiler.Shutdown();
                }
            }
            finally
            {
                RequiresRestartUtility.RequiresRestart = false;
                RequiresRestartUtility.CalledFromUI    = false;
            }
        }