GFGGame_GFGAsset_Binding.cs 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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 GFGGame_GFGAsset_Binding
  16. {
  17. public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
  18. {
  19. BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
  20. MethodBase method;
  21. Type[] args;
  22. Type type = typeof(GFGGame.GFGAsset);
  23. Dictionary<string, List<MethodInfo>> genericMethods = new Dictionary<string, List<MethodInfo>>();
  24. List<MethodInfo> lst = null;
  25. foreach(var m in type.GetMethods())
  26. {
  27. if(m.IsGenericMethodDefinition)
  28. {
  29. if (!genericMethods.TryGetValue(m.Name, out lst))
  30. {
  31. lst = new List<MethodInfo>();
  32. genericMethods[m.Name] = lst;
  33. }
  34. lst.Add(m);
  35. }
  36. }
  37. args = new Type[]{typeof(UnityEngine.Sprite)};
  38. if (genericMethods.TryGetValue("Load", out lst))
  39. {
  40. foreach(var m in lst)
  41. {
  42. if(m.MatchGenericParameters(args, typeof(UnityEngine.Sprite), typeof(System.String)))
  43. {
  44. method = m.MakeGenericMethod(args);
  45. app.RegisterCLRMethodRedirection(method, Load_0);
  46. break;
  47. }
  48. }
  49. }
  50. args = new Type[]{typeof(UnityEngine.GameObject)};
  51. if (genericMethods.TryGetValue("Load", out lst))
  52. {
  53. foreach(var m in lst)
  54. {
  55. if(m.MatchGenericParameters(args, typeof(UnityEngine.GameObject), typeof(System.String)))
  56. {
  57. method = m.MakeGenericMethod(args);
  58. app.RegisterCLRMethodRedirection(method, Load_1);
  59. break;
  60. }
  61. }
  62. }
  63. args = new Type[]{typeof(UnityEngine.TextAsset)};
  64. if (genericMethods.TryGetValue("Load", out lst))
  65. {
  66. foreach(var m in lst)
  67. {
  68. if(m.MatchGenericParameters(args, typeof(UnityEngine.TextAsset), typeof(System.String)))
  69. {
  70. method = m.MakeGenericMethod(args);
  71. app.RegisterCLRMethodRedirection(method, Load_2);
  72. break;
  73. }
  74. }
  75. }
  76. args = new Type[]{typeof(System.String)};
  77. method = type.GetMethod("Release", flag, null, args, null);
  78. app.RegisterCLRMethodRedirection(method, Release_3);
  79. args = new Type[]{typeof(UnityEngine.Font)};
  80. if (genericMethods.TryGetValue("Load", out lst))
  81. {
  82. foreach(var m in lst)
  83. {
  84. if(m.MatchGenericParameters(args, typeof(UnityEngine.Font), typeof(System.String)))
  85. {
  86. method = m.MakeGenericMethod(args);
  87. app.RegisterCLRMethodRedirection(method, Load_4);
  88. break;
  89. }
  90. }
  91. }
  92. }
  93. static StackObject* Load_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  94. {
  95. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  96. StackObject* ptr_of_this_method;
  97. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  98. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  99. System.String @path = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  100. __intp.Free(ptr_of_this_method);
  101. var result_of_this_method = GFGGame.GFGAsset.Load<UnityEngine.Sprite>(@path);
  102. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  103. }
  104. static StackObject* Load_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  105. {
  106. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  107. StackObject* ptr_of_this_method;
  108. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  109. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  110. System.String @path = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  111. __intp.Free(ptr_of_this_method);
  112. var result_of_this_method = GFGGame.GFGAsset.Load<UnityEngine.GameObject>(@path);
  113. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  114. }
  115. static StackObject* Load_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  116. {
  117. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  118. StackObject* ptr_of_this_method;
  119. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  120. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  121. System.String @path = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  122. __intp.Free(ptr_of_this_method);
  123. var result_of_this_method = GFGGame.GFGAsset.Load<UnityEngine.TextAsset>(@path);
  124. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  125. }
  126. static StackObject* Release_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  127. {
  128. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  129. StackObject* ptr_of_this_method;
  130. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  131. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  132. System.String @path = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  133. __intp.Free(ptr_of_this_method);
  134. GFGGame.GFGAsset.Release(@path);
  135. return __ret;
  136. }
  137. static StackObject* Load_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  138. {
  139. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  140. StackObject* ptr_of_this_method;
  141. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  142. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  143. System.String @path = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  144. __intp.Free(ptr_of_this_method);
  145. var result_of_this_method = GFGGame.GFGAsset.Load<UnityEngine.Font>(@path);
  146. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  147. }
  148. }
  149. }