ETModel_GameObjectHelper_Binding.cs 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Reflection;
  5. using System.Runtime.InteropServices;
  6. using ILRuntime.CLR.TypeSystem;
  7. using ILRuntime.CLR.Method;
  8. using ILRuntime.Runtime.Enviorment;
  9. using ILRuntime.Runtime.Intepreter;
  10. using ILRuntime.Runtime.Stack;
  11. using ILRuntime.Reflection;
  12. using ILRuntime.CLR.Utils;
  13. namespace ILRuntime.Runtime.Generated
  14. {
  15. unsafe class ETModel_GameObjectHelper_Binding
  16. {
  17. public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
  18. {
  19. MethodBase method;
  20. Type[] args;
  21. Type type = typeof(ETModel.GameObjectHelper);
  22. Dictionary<string, List<MethodInfo>> genericMethods = new Dictionary<string, List<MethodInfo>>();
  23. List<MethodInfo> lst = null;
  24. foreach(var m in type.GetMethods())
  25. {
  26. if(m.IsGenericMethodDefinition)
  27. {
  28. if (!genericMethods.TryGetValue(m.Name, out lst))
  29. {
  30. lst = new List<MethodInfo>();
  31. genericMethods[m.Name] = lst;
  32. }
  33. lst.Add(m);
  34. }
  35. }
  36. args = new Type[]{typeof(UnityEngine.TextAsset)};
  37. if (genericMethods.TryGetValue("Get", out lst))
  38. {
  39. foreach(var m in lst)
  40. {
  41. if(m.MatchGenericParameters(args, typeof(UnityEngine.TextAsset), typeof(UnityEngine.GameObject), typeof(System.String)))
  42. {
  43. method = m.MakeGenericMethod(args);
  44. app.RegisterCLRMethodRedirection(method, Get_0);
  45. break;
  46. }
  47. }
  48. }
  49. }
  50. static StackObject* Get_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  51. {
  52. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  53. StackObject* ptr_of_this_method;
  54. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  55. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  56. System.String @key = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  57. __intp.Free(ptr_of_this_method);
  58. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  59. UnityEngine.GameObject @gameObject = (UnityEngine.GameObject)typeof(UnityEngine.GameObject).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  60. __intp.Free(ptr_of_this_method);
  61. var result_of_this_method = ETModel.GameObjectHelper.Get<UnityEngine.TextAsset>(@gameObject, @key);
  62. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  63. }
  64. }
  65. }