コード例 #1
0
ファイル: Program.cs プロジェクト: rue-ryuzaki/BansheeEngine
        /// <summary>
        /// Called when the user requests that the editor shuts down. You must manually close the editor from this
        /// method if you choose to accept the users request.
        /// </summary>
        static void OnEditorQuitRequested()
        {
            Action <DialogBox.ResultType> dialogCallback =
                (result) =>
            {
                if (result == DialogBox.ResultType.Yes)
                {
                    TrySaveScene();
                }
                else if (result == DialogBox.ResultType.No)
                {
                    EditorApplication.SaveProject();
                    EditorApplication.Quit();
                }
            };

            if (EditorApplication.IsSceneModified())
            {
                DialogBox.Open("Warning", "You current scene has modifications. Do you wish to save them first?",
                               DialogBox.Type.YesNoCancel, dialogCallback);
            }
            else
            {
                EditorApplication.SaveProject();
                EditorApplication.Quit();
            }
        }
コード例 #2
0
ファイル: BuildWindow.cs プロジェクト: xuebai5/BansheeEngine
        /// <summary>
        /// Starts the build process for the currently selected platform.
        /// </summary>
        private void Build()
        {
            ProgressBar.Show(new LocEdString("Building..."), 0.0f);

            EditorApplication.SaveProject();
            // HACK - Delay build one frame so that progress bar has a chance to show. Use coroutines here once implemented.
            buildScheduledFrame = Time.FrameIdx + 1;
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: rue-ryuzaki/BansheeEngine
        /// <summary>
        /// Attempts to save the current scene, and keeps retrying if failed or until user cancels.
        /// </summary>
        static void TrySaveScene()
        {
            Action success = () =>
            {
                EditorApplication.SaveProject();
                EditorApplication.Quit();
            };

            EditorApplication.SaveScene(success, TrySaveScene);
        }