Ngui 委托

来源:互联网 发布:简单好唱的英文歌知乎 编辑:程序博客网 时间:2024/06/05 19:07

 


/// <summary>

    /// Append a new event delegate to the list.
    /// </summary>

    static public void Add (List<EventDelegatelistEventDelegate evbool oneShot)
    {
        if (list != null)
        {
            for (int i = 0imax = list.Counti < imax; ++i)
            {
                EventDelegate del = list[i];
                if (del != null && del.Equals(ev))
                    return;
            }
            
            EventDelegate ed = new EventDelegate(ev.targetev.methodName);
            ed.oneShot = oneShot;
            list.Add(ed);
        }
        else
        {
            Debug.LogWarning("Attempting to add a callback to a list that's null");
        }
    }
0 0