以下の内容はhttps://baba-s.hatenablog.com/entry/2020/03/25/090000より取得しました。


【Unity】エディタ拡張で Windows のメッセージボックスを表示する方法

概要

C:\Windows\Microsoft.NET\Framework64\vX.X フォルダ内の
System.Windows.Forms.dll を Unity プロジェクトの Editor フォルダに追加して

using System.Windows.Forms;
using UnityEngine;

public static class Example
{
    [UnityEditor.MenuItem( "Tools/Hoge" )]
    private static void Hoge()
    {
        var result = MessageBox.Show
        (
            "ピカチュウ",
            "カイリュー",
            MessageBoxButtons.OKCancel,
            MessageBoxIcon.Warning
        );

        switch ( result )
        {
            case DialogResult.OK: 
                Debug.Log( "OK" );
                break;

            case DialogResult.Cancel: 
                Debug.Log( "Cancel" );
                break;
        }
    }
}

このようなエディタ拡張のスクリプトを作成することで

f:id:baba_s:20200324175002p:plain

エディタ拡張で Windows のメッセージボックスを表示できます




以上の内容はhttps://baba-s.hatenablog.com/entry/2020/03/25/090000より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14