Ejemplo n.º 1
0
        public BuildProcess BuildAsync()
        {
            string errors = null;

            if (!CanBuild(ref errors))
            {
                Debug.LogError(errors);
                return(null);
            }

            BuildStarted?.Invoke();

            m_CurrentBuildProcess = new BuildProcess(this);
            m_CurrentBuildProcess.BuildStopped += OnBuildStopped;
            return(m_CurrentBuildProcess);
        }
Ejemplo n.º 2
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);
            }
        }
Ejemplo n.º 3
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();
        }
Ejemplo n.º 4
0
 void OnBuildStopped()
 {
     m_CurrentBuildProcess.BuildStopped -= OnBuildStopped;
     m_CurrentBuildProcess = null;
     BuildStopped?.Invoke();
 }