forked from MattRix/UnityDecompiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBaseInvokableCall.cs
More file actions
39 lines (39 loc) · 937 Bytes
/
Copy pathBaseInvokableCall.cs
File metadata and controls
39 lines (39 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Reflection;
namespace UnityEngine.Events
{
internal abstract class BaseInvokableCall
{
protected BaseInvokableCall()
{
}
protected BaseInvokableCall(object target, MethodInfo function)
{
if (target == null)
{
throw new ArgumentNullException("target");
}
if (function == null)
{
throw new ArgumentNullException("function");
}
}
public abstract void Invoke(object[] args);
protected static void ThrowOnInvalidArg<T>(object arg)
{
if (arg != null && !(arg is T))
{
throw new ArgumentException(UnityString.Format("Passed argument 'args[0]' is of the wrong type. Type:{0} Expected:{1}", new object[]
{
arg.GetType(),
typeof(T)
}));
}
}
protected static bool AllowInvoke(Delegate @delegate)
{
return @delegate.Method.IsStatic || @delegate.Target != null;
}
public abstract bool Find(object targetObj, MethodInfo method);
}
}