c# delegate

public delegate void VideoFirstEnd();
public delegate void VideoSecondEnd();

public VideoFirstEnd m_OnEnd1;
public VideoSecondEnd m_OnEnd2;

前两句是申明delegate,

后面两句是定义两个变量

m_UIManager.GetComponent<UIRoot>().m_OnEnd1 += Video1PlayEnd;
m_UIManager.GetComponent<UIRoot>().m_OnEnd2 += Video2PlayEnd;

用起来是这样

 

posted on 2017-10-17 16:29  c_dragon  阅读(151)  评论(0编辑  收藏  举报

导航