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

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

Convenience function to check if the specified list of delegates can be executed.
static public IsValid ( List list ) : bool
list List
Результат bool
	static public bool IsValid (List<EventDelegate> list)
	{
		if (list != null)
		{
			for (int i = 0, imax = list.Count; i < imax; ++i)
			{
				EventDelegate del = list[i];
				if (del != null && del.isValid)
					return true;
			}
		}
		return false;
	}

Same methods

EventDelegate::IsValid ( Callback, callback ) : bool

Usage Example

Пример #1
0
 private void OnEnable()
 {
     if (EventDelegate.IsValid(onChange))
     {
         eventReceiver = null;
         functionName  = null;
     }
     if (font != null)
     {
         if (font.isDynamic)
         {
             trueTypeFont    = font.dynamicFont;
             fontStyle       = font.dynamicFontStyle;
             mUseDynamicFont = true;
         }
         else if (bitmapFont == null)
         {
             bitmapFont      = font;
             mUseDynamicFont = false;
         }
         font = null;
     }
     if (textScale != 0f)
     {
         fontSize  = ((!(bitmapFont != null)) ? 16 : Mathf.RoundToInt((float)bitmapFont.defaultSize * textScale));
         textScale = 0f;
     }
     if (trueTypeFont == null && bitmapFont != null && bitmapFont.isDynamic)
     {
         trueTypeFont = bitmapFont.dynamicFont;
         bitmapFont   = null;
     }
 }
All Usage Examples Of EventDelegate::IsValid