diff options
author | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
commit | 15740faf9fe9fe4be08965098bbf2947e096aeeb (patch) | |
tree | a730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/Export/Coroutines.cs |
Diffstat (limited to 'Runtime/Export/Coroutines.cs')
-rw-r--r-- | Runtime/Export/Coroutines.cs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Runtime/Export/Coroutines.cs b/Runtime/Export/Coroutines.cs new file mode 100644 index 0000000..3333b40 --- /dev/null +++ b/Runtime/Export/Coroutines.cs @@ -0,0 +1,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 +} |