引数3つのUnityEvent
ジェネリックのUnityEvent型を使用したい場合は、クラスをオーバーライドする必要があります
#pragma strict
class My3ArgEvent extends UnityEvent.<int, int, int> {}
var m_MyEvent : My3ArgEvent;
function Start ()
{
if (m_MyEvent == null)
m_MyEvent = new My3ArgEvent ();
m_MyEvent.AddListener (Ping);
}
function Update ()
{
if (Input.anyKeyDown && m_MyEvent != null)
{
m_MyEvent.Invoke (5, 6, 7);
}
}
function Ping (i0: int, i1: int, i2: int)
{
Debug.Log (i0 + i1 + i2);
}
no example available in C#
no example available in Boo
| GetPersistentEventCount | 登録されている永続的なリスナーの数を取得します |
| GetPersistentMethodName | インデックスから対象のリスナーのメソッド名を取得します |
| GetPersistentTarget | インデックスから対象のリスナーのコンポーネントを取得します |
| RemoveAllListeners | イベントから全てのリスナーを削除します |
| SetPersistentListenerState | 永続的なリスナーの実行状態を変更します |
| GetValidMethodInfo | オブジェクト、関数名、引数タイプのリストからマッチするメソッドを探します |