// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved. using System.Threading.Tasks; namespace FlaxEditor.Progress.Handlers { /// /// Async scripts project files generation progress reporting handler. /// /// public sealed class GenerateScriptsProjectFilesProgress : ProgressHandler { /// protected override void OnStart() { base.OnStart(); OnUpdate(0.1f, "Generating scripts project files..."); } /// /// Runs the projects generation (as async task). /// public void RunAsync() { if (IsActive) return; Task.Run(Run); } /// /// Runs the projects generation. /// public void Run() { if (IsActive) return; try { OnStart(); var customArgs = Editor.Instance.CodeEditing.SelectedEditor.GenerateProjectCustomArgs; ScriptsBuilder.GenerateProject(customArgs); } finally { OnEnd(); } } } }