ソースコード
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 );