NGUI: Next-Gen UI kit  3.7.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros
EventDelegate Class Reference

Delegate callback that Unity can serialize and set via Inspector. More...

Classes

class  Parameter
 Delegates can have parameters, and this class makes it possible to save references to properties that can then be passed as function arguments, such as transform.position or widget.color. More...
 

Public Member Functions

delegate void Callback ()
 
 EventDelegate ()
 
 EventDelegate (Callback call)
 
 EventDelegate (MonoBehaviour target, string methodName)
 
override bool Equals (object obj)
 Equality operator. More...
 
override int GetHashCode ()
 Used in equality operators. More...
 
void Set (MonoBehaviour target, string methodName)
 Set the delegate callback using the target and method names. More...
 
bool Execute ()
 Execute the delegate, if possible. This will only be used when the application is playing in order to prevent unintentional state changes. More...
 
void Clear ()
 Clear the event delegate. More...
 
override string ToString ()
 Convert the delegate to its string representation. More...
 

Static Public Member Functions

static void Execute (List< EventDelegate > list)
 Execute an entire list of delegates. More...
 
static bool IsValid (List< EventDelegate > list)
 Convenience function to check if the specified list of delegates can be executed. More...
 
static EventDelegate Set (List< EventDelegate > list, Callback callback)
 Assign a new event delegate. More...
 
static void Set (List< EventDelegate > list, EventDelegate del)
 Assign a new event delegate. More...
 
static EventDelegate Add (List< EventDelegate > list, Callback callback)
 Append a new event delegate to the list. More...
 
static EventDelegate Add (List< EventDelegate > list, Callback callback, bool oneShot)
 Append a new event delegate to the list. More...
 
static void Add (List< EventDelegate > list, EventDelegate ev)
 Append a new event delegate to the list. More...
 
static void Add (List< EventDelegate > list, EventDelegate ev, bool oneShot)
 Append a new event delegate to the list. More...
 
static bool Remove (List< EventDelegate > list, Callback callback)
 Remove an existing event delegate from the list. More...
 
static bool Remove (List< EventDelegate > list, EventDelegate ev)
 Remove an existing event delegate from the list. More...
 

Public Attributes

bool oneShot = false
 Whether the event delegate will be removed after execution. More...
 

Properties

MonoBehaviour target [get, set]
 Event delegate's target object. More...
 
string methodName [get, set]
 Event delegate's method name. More...
 
Parameter[] parameters [get]
 Optional parameters if the method requires them. More...
 
bool isValid [get]
 Whether this delegate's values have been set. More...
 
bool isEnabled [get]
 Whether the target script is actually enabled. More...
 

Detailed Description

Delegate callback that Unity can serialize and set via Inspector.

Constructor & Destructor Documentation

EventDelegate.EventDelegate ( )
EventDelegate.EventDelegate ( Callback  call)
EventDelegate.EventDelegate ( MonoBehaviour  target,
string  methodName 
)

Member Function Documentation

static EventDelegate EventDelegate.Add ( List< EventDelegate list,
Callback  callback 
)
static

Append a new event delegate to the list.

static EventDelegate EventDelegate.Add ( List< EventDelegate list,
Callback  callback,
bool  oneShot 
)
static

Append a new event delegate to the list.

static void EventDelegate.Add ( List< EventDelegate list,
EventDelegate  ev 
)
static

Append a new event delegate to the list.

static void EventDelegate.Add ( List< EventDelegate list,
EventDelegate  ev,
bool  oneShot 
)
static

Append a new event delegate to the list.

delegate void EventDelegate.Callback ( )
void EventDelegate.Clear ( )

Clear the event delegate.

override bool EventDelegate.Equals ( object  obj)

Equality operator.

bool EventDelegate.Execute ( )

Execute the delegate, if possible. This will only be used when the application is playing in order to prevent unintentional state changes.

static void EventDelegate.Execute ( List< EventDelegate list)
static

Execute an entire list of delegates.

override int EventDelegate.GetHashCode ( )

Used in equality operators.

static bool EventDelegate.IsValid ( List< EventDelegate list)
static

Convenience function to check if the specified list of delegates can be executed.

static bool EventDelegate.Remove ( List< EventDelegate list,
Callback  callback 
)
static

Remove an existing event delegate from the list.

static bool EventDelegate.Remove ( List< EventDelegate list,
EventDelegate  ev 
)
static

Remove an existing event delegate from the list.

void EventDelegate.Set ( MonoBehaviour  target,
string  methodName 
)

Set the delegate callback using the target and method names.

static EventDelegate EventDelegate.Set ( List< EventDelegate list,
Callback  callback 
)
static

Assign a new event delegate.

static void EventDelegate.Set ( List< EventDelegate list,
EventDelegate  del 
)
static

Assign a new event delegate.

override string EventDelegate.ToString ( )

Convert the delegate to its string representation.

Member Data Documentation

bool EventDelegate.oneShot = false

Whether the event delegate will be removed after execution.

Property Documentation

bool EventDelegate.isEnabled
get

Whether the target script is actually enabled.

bool EventDelegate.isValid
get

Whether this delegate's values have been set.

string EventDelegate.methodName
getset

Event delegate's method name.

Parameter [] EventDelegate.parameters
get

Optional parameters if the method requires them.

MonoBehaviour EventDelegate.target
getset

Event delegate's target object.


The documentation for this class was generated from the following file: