using System; using System.Collections.Generic; using System.Reflection; using System.Runtime.InteropServices; using UnityFusion.CLR.TypeSystem; using UnityFusion.CLR.Method; using UnityFusion.Runtime.Enviorment; using UnityFusion.Runtime.Intepreter; using UnityFusion.Runtime.Stack; using UnityFusion.Reflection; using UnityFusion.CLR.Utils; #if DEBUG && !DISABLE_UNITYFUSION_DEBUG using AutoList = System.Collections.Generic.List; #else using AutoList = UnityFusion.Other.UncheckedList; #endif namespace UnityFusion.Runtime.Generated { unsafe class Fusion_NetworkObjectProviderDefault_Binding { public static void Register(UnityFusion.Runtime.Enviorment.AppDomain app) { BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly; MethodBase method; FieldInfo field; Type[] args; Type type = typeof(Fusion.NetworkObjectProviderDefault); args = new Type[]{typeof(Fusion.NetworkRunner), typeof(Fusion.NetworkPrefabAcquireContext).MakeByRefType(), typeof(Fusion.NetworkObject).MakeByRefType()}; method = type.GetMethod("AcquirePrefabInstance", flag, null, args, null); app.RegisterCLRMethodRedirection(method, AcquirePrefabInstance_0); args = new Type[]{typeof(Fusion.NetworkRunner), typeof(Fusion.NetworkObjectReleaseContext).MakeByRefType()}; method = type.GetMethod("ReleaseInstance", flag, null, args, null); app.RegisterCLRMethodRedirection(method, ReleaseInstance_1); field = type.GetField("DelayIfSceneManagerIsBusy", flag); app.RegisterCLRFieldGetter(field, get_DelayIfSceneManagerIsBusy_0); app.RegisterCLRFieldSetter(field, set_DelayIfSceneManagerIsBusy_0); app.RegisterCLRFieldBinding(field, CopyToStack_DelayIfSceneManagerIsBusy_0, AssignFromStack_DelayIfSceneManagerIsBusy_0); app.RegisterCLRCreateDefaultInstance(type, () => new Fusion.NetworkObjectProviderDefault()); app.RegisterCLRCreateArrayInstance(type, s => new Fusion.NetworkObjectProviderDefault[s]); args = new Type[]{}; method = type.GetConstructor(flag, null, args, null); app.RegisterCLRMethodRedirection(method, Ctor_0); } static StackObject* AcquirePrefabInstance_0(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 4); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); Fusion.NetworkObject @instance = (Fusion.NetworkObject)typeof(Fusion.NetworkObject).CheckCLRTypes(__intp.RetriveObject(ptr_of_this_method, __mStack), (CLR.Utils.Extensions.TypeFlags)0); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); Fusion.NetworkPrefabAcquireContext @context = (Fusion.NetworkPrefabAcquireContext)typeof(Fusion.NetworkPrefabAcquireContext).CheckCLRTypes(__intp.RetriveObject(ptr_of_this_method, __mStack), (CLR.Utils.Extensions.TypeFlags)16); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); Fusion.NetworkRunner @runner = (Fusion.NetworkRunner)typeof(Fusion.NetworkRunner).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0); ptr_of_this_method = ILIntepreter.Minus(__esp, 4); Fusion.NetworkObjectProviderDefault instance_of_this_method = (Fusion.NetworkObjectProviderDefault)typeof(Fusion.NetworkObjectProviderDefault).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0); var result_of_this_method = instance_of_this_method.AcquirePrefabInstance(@runner, in @context, out @instance); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); switch(ptr_of_this_method->ObjectType) { case ObjectTypes.StackObjectReference: { var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method); object ___obj = @instance; if (___dst->ObjectType >= ObjectTypes.Object) { if (___obj is CrossBindingAdaptorType) ___obj = ((CrossBindingAdaptorType)___obj).ILInstance; __mStack[___dst->Value] = ___obj; } else { ILIntepreter.UnboxObject(___dst, ___obj, __mStack, __domain); } } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if(___obj is ILTypeInstance) { ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @instance; } else { var ___type = __domain.GetType(___obj.GetType()) as CLRType; ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @instance); } } break; case ObjectTypes.StaticFieldReference: { var ___type = __domain.GetType(ptr_of_this_method->Value); if(___type is ILType) { ((ILType)___type).StaticInstance[ptr_of_this_method->ValueLow] = @instance; } else { ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @instance); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as Fusion.NetworkObject[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = @instance; } break; } __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); switch(ptr_of_this_method->ObjectType) { case ObjectTypes.StackObjectReference: { var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method); object ___obj = @context; if (___dst->ObjectType >= ObjectTypes.Object) { if (___obj is CrossBindingAdaptorType) ___obj = ((CrossBindingAdaptorType)___obj).ILInstance; __mStack[___dst->Value] = ___obj; } else { ILIntepreter.UnboxObject(___dst, ___obj, __mStack, __domain); } } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if(___obj is ILTypeInstance) { ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @context; } else { var ___type = __domain.GetType(___obj.GetType()) as CLRType; ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @context); } } break; case ObjectTypes.StaticFieldReference: { var ___type = __domain.GetType(ptr_of_this_method->Value); if(___type is ILType) { ((ILType)___type).StaticInstance[ptr_of_this_method->ValueLow] = @context; } else { ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @context); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as Fusion.NetworkPrefabAcquireContext[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = @context; } break; } __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 4); __intp.Free(ptr_of_this_method); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } static StackObject* ReleaseInstance_1(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* ptr_of_this_method; StackObject* __ret = ILIntepreter.Minus(__esp, 3); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); Fusion.NetworkObjectReleaseContext @context = (Fusion.NetworkObjectReleaseContext)typeof(Fusion.NetworkObjectReleaseContext).CheckCLRTypes(__intp.RetriveObject(ptr_of_this_method, __mStack), (CLR.Utils.Extensions.TypeFlags)16); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); Fusion.NetworkRunner @runner = (Fusion.NetworkRunner)typeof(Fusion.NetworkRunner).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); Fusion.NetworkObjectProviderDefault instance_of_this_method = (Fusion.NetworkObjectProviderDefault)typeof(Fusion.NetworkObjectProviderDefault).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0); instance_of_this_method.ReleaseInstance(@runner, in @context); ptr_of_this_method = ILIntepreter.Minus(__esp, 1); switch(ptr_of_this_method->ObjectType) { case ObjectTypes.StackObjectReference: { var ___dst = ILIntepreter.ResolveReference(ptr_of_this_method); object ___obj = @context; if (___dst->ObjectType >= ObjectTypes.Object) { if (___obj is CrossBindingAdaptorType) ___obj = ((CrossBindingAdaptorType)___obj).ILInstance; __mStack[___dst->Value] = ___obj; } else { ILIntepreter.UnboxObject(___dst, ___obj, __mStack, __domain); } } break; case ObjectTypes.FieldReference: { var ___obj = __mStack[ptr_of_this_method->Value]; if(___obj is ILTypeInstance) { ((ILTypeInstance)___obj)[ptr_of_this_method->ValueLow] = @context; } else { var ___type = __domain.GetType(___obj.GetType()) as CLRType; ___type.SetFieldValue(ptr_of_this_method->ValueLow, ref ___obj, @context); } } break; case ObjectTypes.StaticFieldReference: { var ___type = __domain.GetType(ptr_of_this_method->Value); if(___type is ILType) { ((ILType)___type).StaticInstance[ptr_of_this_method->ValueLow] = @context; } else { ((CLRType)___type).SetStaticFieldValue(ptr_of_this_method->ValueLow, @context); } } break; case ObjectTypes.ArrayReference: { var instance_of_arrayReference = __mStack[ptr_of_this_method->Value] as Fusion.NetworkObjectReleaseContext[]; instance_of_arrayReference[ptr_of_this_method->ValueLow] = @context; } break; } __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 2); __intp.Free(ptr_of_this_method); ptr_of_this_method = ILIntepreter.Minus(__esp, 3); __intp.Free(ptr_of_this_method); return __ret; } static object get_DelayIfSceneManagerIsBusy_0(ref object o) { return ((Fusion.NetworkObjectProviderDefault)o).DelayIfSceneManagerIsBusy; } static StackObject* CopyToStack_DelayIfSceneManagerIsBusy_0(ref object o, ILIntepreter __intp, StackObject* __ret, AutoList __mStack) { var result_of_this_method = ((Fusion.NetworkObjectProviderDefault)o).DelayIfSceneManagerIsBusy; __ret->ObjectType = ObjectTypes.Integer; __ret->Value = result_of_this_method ? 1 : 0; return __ret + 1; } static void set_DelayIfSceneManagerIsBusy_0(ref object o, object v) { ((Fusion.NetworkObjectProviderDefault)o).DelayIfSceneManagerIsBusy = (System.Boolean)v; } static StackObject* AssignFromStack_DelayIfSceneManagerIsBusy_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, AutoList __mStack) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; System.Boolean @DelayIfSceneManagerIsBusy = ptr_of_this_method->Value == 1; ((Fusion.NetworkObjectProviderDefault)o).DelayIfSceneManagerIsBusy = @DelayIfSceneManagerIsBusy; return ptr_of_this_method; } static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, AutoList __mStack, CLRMethod __method, bool isNewObj) { UnityFusion.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain; StackObject* __ret = ILIntepreter.Minus(__esp, 0); var result_of_this_method = new Fusion.NetworkObjectProviderDefault(); return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method); } } }