Beispiel #1
0
        public MethodInfo FindMethod(string name, object listener, TestityPersistentListenerMode mode, Type argumentType)
        {
            switch (mode)
            {
            case TestityPersistentListenerMode.EventDefined:
            {
                return(this.FindMethod_Impl(name, listener));
            }

            case TestityPersistentListenerMode.Void:
            {
                return(TestityEventBase.GetValidMethodInfo(listener, name, new Type[0]));
            }

            case TestityPersistentListenerMode.Object:
            {
                return(TestityEventBase.GetValidMethodInfo(listener, name, new Type[] { argumentType ?? typeof(UnityEngine.Object) }));
            }

            case TestityPersistentListenerMode.Int:
            {
                return(TestityEventBase.GetValidMethodInfo(listener, name, new Type[] { typeof(int) }));
            }

            case TestityPersistentListenerMode.Float:
            {
                return(TestityEventBase.GetValidMethodInfo(listener, name, new Type[] { typeof(float) }));
            }

            case TestityPersistentListenerMode.String:
            {
                return(TestityEventBase.GetValidMethodInfo(listener, name, new Type[] { typeof(string) }));
            }

            case TestityPersistentListenerMode.Bool:
            {
                return(TestityEventBase.GetValidMethodInfo(listener, name, new Type[] { typeof(bool) }));
            }
            }
            return(null);
        }
 protected override MethodInfo FindMethod_Impl(string name, object targetObj)
 {
     return(TestityEventBase.GetValidMethodInfo(targetObj, name, new Type[0]));
 }