/// <summary>
/// Append a new event delegate to the list./// </summary>
static public void Add (List<EventDelegate> list, EventDelegate ev, bool oneShot)
{
if (list != null)
{
for (int i = 0, imax = list.Count; i < imax; ++i)
{
EventDelegate del = list[i];
if (del != null && del.Equals(ev))
return;
}
EventDelegate ed = new EventDelegate(ev.target, ev.methodName);
ed.oneShot = oneShot;
list.Add(ed);
}
else
{
Debug.LogWarning("Attempting to add a callback to a list that's null");
}
}