summaryrefslogtreecommitdiff
path: root/Runtime/Export/Coroutines.cs
blob: 3333b40364cbb6a1e5955c74bf1772d66009f90f (plain)
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
using System;
using System.Collections;
using System.Reflection;

namespace UnityEngine
{
#if ENABLE_MONO || UNITY_WP8
internal class SetupCoroutine
{
	static public object InvokeMember (object behaviour, string name, object variable)
	{
		object[] args = null;
		if (variable != null)
		{
			args = new System.Object[1];
			args[0] = variable;
		}
			
		return behaviour.GetType ().InvokeMember (name, BindingFlags.InvokeMethod | BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, null, behaviour, args, null, null, null);
	}

	static public object InvokeStatic (Type klass, string name, object variable)
	{
		object[] args = null;
		if (variable != null)
		{
			args = new System.Object[1];
			args[0] = variable;
		}

		return klass.InvokeMember (name, BindingFlags.InvokeMethod | BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public, null, null, args, null, null, null);
	}

}
#endif
}