EventDelegate.Remove C# (CSharp) Метод

Remove() статический публичный Метод

Remove an existing event delegate from the list.
static public Remove ( List list, Callback, callback ) : bool
list List
callback Callback,
Результат bool
	static public bool Remove (List<EventDelegate> list, Callback callback)
	{
		if (list != null)
		{
			for (int i = 0, imax = list.Count; i < imax; ++i)
			{
				EventDelegate del = list[i];
				
				if (del != null && del.Equals(callback))
				{
					list.RemoveAt(i);
					return true;
				}
			}
		}
		return false;
	}
}

Usage Example

Пример #1
0
 public void AnimaionFinish()
 {
     if (m_Anim != null)
     {
         m_Anim.StopAllCoroutines();
         EventDelegate.Remove(m_Anim.onFinished, AnimaionFinish);
     }
     InitState();
 }
All Usage Examples Of EventDelegate::Remove