Here are the examples of the csharp api System.Collections.Generic.Dictionary.ContainsKey(UnityAction) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
19
Source : UXEventDelegate.cs
with MIT License
from unfernojp
with MIT License
from unfernojp
public static bool Execute( UXEventData eventData ) {
if ( !_initialized ) { throw new Exception( string.Format( "{0} is not initialized.", "UXEventDelegate" ) ); }
if ( eventData == null ) { throw new Exception( string.Format( "Argument {1} of method {0} can not be omitted.", "Execute()", "eventData" ) ); }
UnityEventBase unityEventBase = _getUnityEventBase( eventData.target, eventData.name );
if ( unityEventBase == null ) { return true; }
if ( _eventCallbacks.ContainsKey( unityEventBase ) ) {
List<UnityAction> callbacks = _eventCallbacks[unityEventBase];
for ( int i = 0; i < callbacks.Count; i++ ) {
UnityAction callback = callbacks[i] as UnityAction;
if ( _callbackEventDatas.ContainsKey( callback ) ) {
_callbackEventDatas[callback] = eventData;
} else {
_callbackEventDatas.Add( callback, eventData );
}
}
}
UnityEvent unityEvent = unityEventBase as UnityEvent;
if ( unityEvent != null ) {
unityEvent.Invoke();
}
if ( _eventCallbacks.ContainsKey( unityEventBase ) ) {
List<UnityAction> callbacks = _eventCallbacks[unityEventBase];
for ( int i = 0; i < callbacks.Count; i++ ) {
_callbackEventDatas.Remove( callbacks[i] );
}
}
if ( eventData.IsDefaultPrevented() ) { return false; }
return true;
}
19
Source : UXEventDelegate.cs
with MIT License
from unfernojp
with MIT License
from unfernojp
public static UXEventData GetEventData( UnityAction callback ) {
if ( !_initialized ) { throw new Exception( string.Format( "{0} is not initialized.", "UXEventDelegate" ) ); }
if ( callback == null ) { throw new Exception( string.Format( "Argument {1} of method {0} can not be omitted.", "GetEventData()", "callback" ) ); }
if ( _callbackEventDatas.ContainsKey( callback ) ) { return _callbackEventDatas[callback]; }
return null;
}