EventDelegate.Add C# (CSharp) Method

Add() static public method

Append a new event delegate to the list.
static public Add ( List list, Callback, callback ) : void
list List
callback Callback,
return void
	static public void Add (List<EventDelegate> list, Callback callback) { Add(list, callback, false); }

Same methods

EventDelegate::Add ( List list, Callback, callback, bool oneShot ) : void
EventDelegate::Add ( List list, EventDelegate, ev ) : void
EventDelegate::Add ( List list, EventDelegate, ev, bool oneShot ) : void

Usage Example

    private void Awake()
    {
        if (target != null)
        {
            if (activate.Count == 0 && deactivate.Count == 0)
            {
                if (inverse)
                {
                    deactivate.Add(target);
                }
                else
                {
                    activate.Add(target);
                }
            }
            else
            {
                target = null;
            }
        }
        UIToggle component = GetComponent <UIToggle>();

        EventDelegate.Add(component.onChange, Toggle);
    }
All Usage Examples Of EventDelegate::Add