Exemple #1
0
 private void OnDestroy()
 {
     DestroyScriptingEnvironment();
     PythonEnvironment.DestroyEngine();
     Destroy(DependencyInstaller.Instance);
     Destroy(BlockHandlerController.Instance);
     Destroy(Watchlist.Instance);
     Destroy(IdentifierDisplay.Instance);
     Destroy(ScriptOptions.Instance);
 }
        /// <summary>
        ///     Sets the Python engine version and reloads.
        /// </summary>
        public static void SetVersionAndReload(string version)
        {
            var requiresReload = PythonEnvironment.Version != version;

            PythonEnvironment.Version = version;

            if (!requiresReload)
            {
                return;
            }
            if (LoadEngine(true))
            {
                return;
            }

            PythonEnvironment.DestroyEngine();
            DependencyInstaller.InstallIronPython();
        }