/UHotGames/Assets/Plugins/ILRuntime/Generated/UnityEngine_Vector3_Binding.cs

https://github.com/yukuyoulei/ILRuntime_HotGames · C# · 220 lines · 186 code · 34 blank · 0 comment · 3 complexity · 553abe5571afe2dfe6a9f40f64da8913 MD5 · raw file

  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 UnityEngine_Vector3_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. FieldInfo field;
  22. Type[] args;
  23. Type type = typeof(UnityEngine.Vector3);
  24. args = new Type[]{};
  25. method = type.GetMethod("get_zero", flag, null, args, null);
  26. app.RegisterCLRMethodRedirection(method, get_zero_0);
  27. args = new Type[]{typeof(UnityEngine.Vector3)};
  28. method = type.GetMethod("Equals", flag, null, args, null);
  29. app.RegisterCLRMethodRedirection(method, Equals_1);
  30. args = new Type[]{typeof(UnityEngine.Vector3), typeof(UnityEngine.Vector3), typeof(System.Single)};
  31. method = type.GetMethod("Lerp", flag, null, args, null);
  32. app.RegisterCLRMethodRedirection(method, Lerp_2);
  33. field = type.GetField("y", flag);
  34. app.RegisterCLRFieldGetter(field, get_y_0);
  35. app.RegisterCLRFieldSetter(field, set_y_0);
  36. field = type.GetField("z", flag);
  37. app.RegisterCLRFieldGetter(field, get_z_1);
  38. app.RegisterCLRFieldSetter(field, set_z_1);
  39. field = type.GetField("x", flag);
  40. app.RegisterCLRFieldGetter(field, get_x_2);
  41. app.RegisterCLRFieldSetter(field, set_x_2);
  42. app.RegisterCLRCreateDefaultInstance(type, () => new UnityEngine.Vector3());
  43. args = new Type[]{typeof(System.Single), typeof(System.Single)};
  44. method = type.GetConstructor(flag, null, args, null);
  45. app.RegisterCLRMethodRedirection(method, Ctor_0);
  46. }
  47. static void WriteBackInstance(ILRuntime.Runtime.Enviorment.AppDomain __domain, StackObject* ptr_of_this_method, IList<object> __mStack, ref UnityEngine.Vector3 instance_of_this_method)
  48. {
  49. ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
  50. switch(ptr_of_this_method->ObjectType)
  51. {
  52. case ObjectTypes.Object:
  53. {
  54. __mStack[ptr_of_this_method->Value] = instance_of_this_method;
  55. }
  56. break;
  57. case ObjectTypes.FieldReference:
  58. {
  59. var ___obj = __mStack[ptr_of_this_method->Value];
  60. if(___obj is ILTypeInstance)
  61. {
  62. ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method;
  63. }
  64. else
  65. {
  66. var t = __domain.GetType(___obj.GetType()) as CLRType;
  67. t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method);
  68. }
  69. }
  70. break;
  71. case ObjectTypes.StaticFieldReference:
  72. {
  73. var t = __domain.GetType(ptr_of_this_method->Value);
  74. if(t is ILType)
  75. {
  76. ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method;
  77. }
  78. else
  79. {
  80. ((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method);
  81. }
  82. }
  83. break;
  84. case ObjectTypes.ArrayReference:
  85. {
  86. var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as UnityEngine.Vector3[];
  87. instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method;
  88. }
  89. break;
  90. }
  91. }
  92. static StackObject* get_zero_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  93. {
  94. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  95. StackObject* __ret = ILIntepreter.Minus(__esp, 0);
  96. var result_of_this_method = UnityEngine.Vector3.zero;
  97. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  98. }
  99. static StackObject* Equals_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  100. {
  101. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  102. StackObject* ptr_of_this_method;
  103. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  104. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  105. UnityEngine.Vector3 @other = (UnityEngine.Vector3)typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  106. __intp.Free(ptr_of_this_method);
  107. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  108. ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
  109. UnityEngine.Vector3 instance_of_this_method = (UnityEngine.Vector3)typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  110. var result_of_this_method = instance_of_this_method.Equals(@other);
  111. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  112. WriteBackInstance(__domain, ptr_of_this_method, __mStack, ref instance_of_this_method);
  113. __intp.Free(ptr_of_this_method);
  114. __ret->ObjectType = ObjectTypes.Integer;
  115. __ret->Value = result_of_this_method ? 1 : 0;
  116. return __ret + 1;
  117. }
  118. static StackObject* Lerp_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  119. {
  120. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  121. StackObject* ptr_of_this_method;
  122. StackObject* __ret = ILIntepreter.Minus(__esp, 3);
  123. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  124. System.Single @t = *(float*)&ptr_of_this_method->Value;
  125. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  126. UnityEngine.Vector3 @b = (UnityEngine.Vector3)typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  127. __intp.Free(ptr_of_this_method);
  128. ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
  129. UnityEngine.Vector3 @a = (UnityEngine.Vector3)typeof(UnityEngine.Vector3).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  130. __intp.Free(ptr_of_this_method);
  131. var result_of_this_method = UnityEngine.Vector3.Lerp(@a, @b, @t);
  132. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  133. }
  134. static object get_y_0(ref object o)
  135. {
  136. return ((UnityEngine.Vector3)o).y;
  137. }
  138. static void set_y_0(ref object o, object v)
  139. {
  140. var h = GCHandle.Alloc(o, GCHandleType.Pinned);
  141. UnityEngine.Vector3* p = (UnityEngine.Vector3 *)(void *)h.AddrOfPinnedObject();
  142. p->y = (System.Single)v;
  143. h.Free();
  144. }
  145. static object get_z_1(ref object o)
  146. {
  147. return ((UnityEngine.Vector3)o).z;
  148. }
  149. static void set_z_1(ref object o, object v)
  150. {
  151. var h = GCHandle.Alloc(o, GCHandleType.Pinned);
  152. UnityEngine.Vector3* p = (UnityEngine.Vector3 *)(void *)h.AddrOfPinnedObject();
  153. p->z = (System.Single)v;
  154. h.Free();
  155. }
  156. static object get_x_2(ref object o)
  157. {
  158. return ((UnityEngine.Vector3)o).x;
  159. }
  160. static void set_x_2(ref object o, object v)
  161. {
  162. var h = GCHandle.Alloc(o, GCHandleType.Pinned);
  163. UnityEngine.Vector3* p = (UnityEngine.Vector3 *)(void *)h.AddrOfPinnedObject();
  164. p->x = (System.Single)v;
  165. h.Free();
  166. }
  167. static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  168. {
  169. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  170. StackObject* ptr_of_this_method;
  171. StackObject* __ret = ILIntepreter.Minus(__esp, 2);
  172. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  173. System.Single @y = *(float*)&ptr_of_this_method->Value;
  174. ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
  175. System.Single @x = *(float*)&ptr_of_this_method->Value;
  176. var result_of_this_method = new UnityEngine.Vector3(@x, @y);
  177. if(!isNewObj)
  178. {
  179. __ret--;
  180. WriteBackInstance(__domain, __ret, __mStack, ref result_of_this_method);
  181. return __ret;
  182. }
  183. return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
  184. }
  185. }
  186. }