c# delegate

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

public VideoFirstEnd m_OnEnd1;
public VideoSecondEnd m_OnEnd2;

前两句是申明delegate,ide

后面两句是定义两个变量spa

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

用起来是这样code

相关文章
相关标签/搜索