EventDelegate.Remove C# (CSharp) Method

Remove() static public method

Remove an existing event delegate from the list.
static public Remove ( List list, Callback, callback ) : bool
list List
callback Callback,
return 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

 public void AnimaionFinish()
 {
     if (m_Anim != null)
     {
         m_Anim.StopAllCoroutines();
         EventDelegate.Remove(m_Anim.onFinished, AnimaionFinish);
     }
     InitState();
 }
All Usage Examples Of EventDelegate::Remove