public BaseInvokableCall GetRuntimeCall(UnityEventBase theEvent)
{
if ((this.m_CallState != UnityEventCallState.RuntimeOnly) || Application.isPlaying)
{
if ((this.m_CallState == UnityEventCallState.Off) || (theEvent == null))
{
return null;
}
MethodInfo theFunction = theEvent.FindMethod(this);
if (theFunction == null)
{
return null;
}
switch (this.m_Mode)
{
case PersistentListenerMode.EventDefined:
return theEvent.GetDelegate(this.target, theFunction);
case PersistentListenerMode.Void:
return new InvokableCall(this.target, theFunction);
case PersistentListenerMode.Object:
return GetObjectCall(this.target, theFunction, this.m_Arguments);
case PersistentListenerMode.Int:
return new CachedInvokableCall<int>(this.target, theFunction, this.m_Arguments.intArgument);
case PersistentListenerMode.Float:
return new CachedInvokableCall<float>(this.target, theFunction, this.m_Arguments.floatArgument);
case PersistentListenerMode.String:
return new CachedInvokableCall<string>(this.target, theFunction, this.m_Arguments.stringArgument);
case PersistentListenerMode.Bool:
return new CachedInvokableCall<bool>(this.target, theFunction, this.m_Arguments.boolArgument);
}
}
return null;
}