0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Unityエディタ上でビルド完了時にダイアログを表示するサンプル

Posted at

Unityエディタ上でビルド完了時にダイアログを表示するサンプル

Buildに時間がかかるので別の作業をするみたいなことをしていると、Buildしたのかどうかを忘れてしまう事があるのを何とかしたいと思っていたら、IPostprocessBuildWithReport というのを実装すればいいと知ったのでメモ

コード例

using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEngine;

public class BuildDialog : IPostprocessBuildWithReport
{
    public int callbackOrder => 0;

    public void OnPostprocessBuild(BuildReport report)
    {
        // Unityエディタ上でダイアログを表示
        EditorUtility.DisplayDialog(
            "Build 完了",
            "ビルドが完了しました。",
            "OK"
        );
    }
}

作成したスクリプトを Editor フォルダに配置してください。

配置場所の例
Assets/
  MyAssets/
    Editor/
      BuildDialog.cs
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?