GetObjectCall() 개인적인 정적인 메소드

private static GetObjectCall ( UnityEngine target, MethodInfo method, ArgumentCache arguments ) : BaseInvokableCall
target UnityEngine
method System.Reflection.MethodInfo
arguments ArgumentCache
리턴 BaseInvokableCall
예제 #1
0
        public BaseInvokableCall GetRuntimeCall(UnityEventBase theEvent)
        {
            BaseInvokableCall result;

            if (this.m_CallState == UnityEventCallState.RuntimeOnly && !Application.isPlaying)
            {
                result = null;
            }
            else if (this.m_CallState == UnityEventCallState.Off || theEvent == null)
            {
                result = null;
            }
            else
            {
                MethodInfo methodInfo = theEvent.FindMethod(this);
                if (methodInfo == null)
                {
                    result = null;
                }
                else
                {
                    switch (this.m_Mode)
                    {
                    case PersistentListenerMode.EventDefined:
                        result = theEvent.GetDelegate(this.target, methodInfo);
                        break;

                    case PersistentListenerMode.Void:
                        result = new InvokableCall(this.target, methodInfo);
                        break;

                    case PersistentListenerMode.Object:
                        result = PersistentCall.GetObjectCall(this.target, methodInfo, this.m_Arguments);
                        break;

                    case PersistentListenerMode.Int:
                        result = new CachedInvokableCall <int>(this.target, methodInfo, this.m_Arguments.intArgument);
                        break;

                    case PersistentListenerMode.Float:
                        result = new CachedInvokableCall <float>(this.target, methodInfo, this.m_Arguments.floatArgument);
                        break;

                    case PersistentListenerMode.String:
                        result = new CachedInvokableCall <string>(this.target, methodInfo, this.m_Arguments.stringArgument);
                        break;

                    case PersistentListenerMode.Bool:
                        result = new CachedInvokableCall <bool>(this.target, methodInfo, this.m_Arguments.boolArgument);
                        break;

                    default:
                        result = null;
                        break;
                    }
                }
            }
            return(result);
        }
예제 #2
0
        public BaseInvokableCall GetRuntimeCall(UnityEventBase theEvent)
        {
            if (this.m_CallState == UnityEventCallState.RuntimeOnly && !Application.isPlaying)
            {
                return((BaseInvokableCall)null);
            }
            if (this.m_CallState == UnityEventCallState.Off || theEvent == null)
            {
                return((BaseInvokableCall)null);
            }
            MethodInfo method = theEvent.FindMethod(this);

            if (method == null)
            {
                return((BaseInvokableCall)null);
            }
            switch (this.m_Mode)
            {
            case PersistentListenerMode.EventDefined:
                return(theEvent.GetDelegate((object)this.target, method));

            case PersistentListenerMode.Void:
                return((BaseInvokableCall) new InvokableCall((object)this.target, method));

            case PersistentListenerMode.Object:
                return(PersistentCall.GetObjectCall(this.target, method, this.m_Arguments));

            case PersistentListenerMode.Int:
                return((BaseInvokableCall) new CachedInvokableCall <int>(this.target, method, this.m_Arguments.intArgument));

            case PersistentListenerMode.Float:
                return((BaseInvokableCall) new CachedInvokableCall <float>(this.target, method, this.m_Arguments.floatArgument));

            case PersistentListenerMode.String:
                return((BaseInvokableCall) new CachedInvokableCall <string>(this.target, method, this.m_Arguments.stringArgument));

            case PersistentListenerMode.Bool:
                return((BaseInvokableCall) new CachedInvokableCall <bool>(this.target, method, this.m_Arguments.boolArgument));

            default:
                return((BaseInvokableCall)null);
            }
        }