Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsubaki/16954265a710e46d86e5 to your computer and use it in GitHub Desktop.
Save tsubaki/16954265a710e46d86e5 to your computer and use it in GitHub Desktop.
IEventSystemHandlerを継承したインターフェースのメソッドを呼び出す 説明用その2
using UnityEngine;
using System.Collections;
using UnityEngine.EventSystems;
public class Sender : MonoBehaviour
{
[SerializeField]
private int count = 30;
void Start ()
{
// インターフェースを継承しているコンポーネントのメソッドを呼び出し
ExecuteEvents.Execute<IRecieveMessage>(
target: gameObject, // 呼び出す対象のオブジェクト
eventData: null, // イベントデータ(モジュール等の情報)
functor: (recieveTarget,y)=>recieveTarget.OnRecieve(count)); // 操作
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment