以下の内容はhttps://baba-s.hatenablog.com/entry/2018/05/26/131000より取得しました。


【Unity】UnityEvent の AddListener で System.Action を渡せるようにする拡張メソッド

ソースコード

using System;
using UnityEngine.Events;

public static class UnityEventExt
{
    public static void AddListener( this UnityEvent self, Action call )
    {
        self.AddListener( () => call() );
    }
}

使用例

Action call = () => {};
button.onClick.AddListener( call );



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

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