UnityEngine_LayerMask_Binding.cs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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_LayerMask_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(UnityEngine.LayerMask);
  23. args = new Type[]{typeof(System.String[])};
  24. method = type.GetMethod("GetMask", flag, null, args, null);
  25. app.RegisterCLRMethodRedirection(method, GetMask_0);
  26. args = new Type[]{typeof(System.String)};
  27. method = type.GetMethod("NameToLayer", flag, null, args, null);
  28. app.RegisterCLRMethodRedirection(method, NameToLayer_1);
  29. app.RegisterCLRCreateDefaultInstance(type, () => new UnityEngine.LayerMask());
  30. }
  31. static void WriteBackInstance(ILRuntime.Runtime.Enviorment.AppDomain __domain, StackObject* ptr_of_this_method, IList<object> __mStack, ref UnityEngine.LayerMask instance_of_this_method)
  32. {
  33. ptr_of_this_method = ILIntepreter.GetObjectAndResolveReference(ptr_of_this_method);
  34. switch(ptr_of_this_method->ObjectType)
  35. {
  36. case ObjectTypes.Object:
  37. {
  38. __mStack[ptr_of_this_method->Value] = instance_of_this_method;
  39. }
  40. break;
  41. case ObjectTypes.FieldReference:
  42. {
  43. var ___obj = __mStack[ptr_of_this_method->Value];
  44. if(___obj is ILTypeInstance)
  45. {
  46. ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = instance_of_this_method;
  47. }
  48. else
  49. {
  50. var t = __domain.GetType(___obj.GetType()) as CLRType;
  51. t.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, instance_of_this_method);
  52. }
  53. }
  54. break;
  55. case ObjectTypes.StaticFieldReference:
  56. {
  57. var t = __domain.GetType(ptr_of_this_method->Value);
  58. if(t is ILType)
  59. {
  60. ((ILType)t).StaticInstance[ptr_of_this_method->ValueLow] = instance_of_this_method;
  61. }
  62. else
  63. {
  64. ((CLRType)t).SetStaticFieldValue(ptr_of_this_method->ValueLow, instance_of_this_method);
  65. }
  66. }
  67. break;
  68. case ObjectTypes.ArrayReference:
  69. {
  70. var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as UnityEngine.LayerMask[];
  71. instance_of_arrayReference[ptr_of_this_method->ValueLow] = instance_of_this_method;
  72. }
  73. break;
  74. }
  75. }
  76. static StackObject* GetMask_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  77. {
  78. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  79. StackObject* ptr_of_this_method;
  80. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  81. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  82. System.String[] @layerNames = (System.String[])typeof(System.String[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  83. __intp.Free(ptr_of_this_method);
  84. var result_of_this_method = UnityEngine.LayerMask.GetMask(@layerNames);
  85. __ret->ObjectType = ObjectTypes.Integer;
  86. __ret->Value = result_of_this_method;
  87. return __ret + 1;
  88. }
  89. static StackObject* NameToLayer_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
  90. {
  91. ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
  92. StackObject* ptr_of_this_method;
  93. StackObject* __ret = ILIntepreter.Minus(__esp, 1);
  94. ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
  95. System.String @layerName = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
  96. __intp.Free(ptr_of_this_method);
  97. var result_of_this_method = UnityEngine.LayerMask.NameToLayer(@layerName);
  98. __ret->ObjectType = ObjectTypes.Integer;
  99. __ret->Value = result_of_this_method;
  100. return __ret + 1;
  101. }
  102. }
  103. }