Пример #1
0
        void UpdateBuildProcess()
        {
            m_BuildProcess.FrameUpdate();

            if (m_BuildProcess.IsFinished)
            {
                m_BuildProcess.Builder.progressFeedback -= DisplayProgressBar;
                EditorApplication.update -= UpdateBuildProcess;

                m_BuildProcess.Dispose();
                m_BuildProcess = null;

                HideProgressBar();
                DisplayCancelBuildButton(false);
                SetAssetEditingEnabled(true);
            }
        }
Пример #2
0
        /// <summary>
        /// Builds the binary for this asset
        /// </summary>
        public void BuildSync()
        {
            EditorUtility.DisplayProgressBar($"Building Kinematica Asset {name}.asset", "", 0.0f);

            using (BuildProcess buildProcess = BuildAsync())
            {
                BuildStarted?.Invoke();
                buildProcess.Builder.progressFeedback += progressInfo => EditorUtility.DisplayProgressBar($"Building Kinematica Asset {name}.asset", progressInfo.title, progressInfo.progress);

                while (!buildProcess.IsFinished)
                {
                    buildProcess.FrameUpdate();
                }

                BuildStopped?.Invoke();
            }

            EditorUtility.ClearProgressBar();
        }