#if USE_UNI_LUA using LuaAPI = UniLua.Lua; using RealStatePtr = UniLua.ILuaState; using LuaCSFunction = UniLua.CSharpFunctionDelegate; #else using LuaAPI = XLua.LuaDLL.Lua; using RealStatePtr = System.IntPtr; using LuaCSFunction = XLua.LuaDLL.lua_CSFunction; #endif using System; namespace XLua { public partial class ObjectTranslator { class IniterAdderUnityEngineVector2 { static IniterAdderUnityEngineVector2() { LuaEnv.AddIniter(Init); } static void Init(LuaEnv luaenv, ObjectTranslator translator) { translator.RegisterPushAndGetAndUpdate(translator.PushUnityEngineVector2, translator.Get, translator.UpdateUnityEngineVector2); translator.RegisterPushAndGetAndUpdate(translator.PushUnityEngineVector3, translator.Get, translator.UpdateUnityEngineVector3); translator.RegisterPushAndGetAndUpdate(translator.PushUnityEngineVector4, translator.Get, translator.UpdateUnityEngineVector4); translator.RegisterPushAndGetAndUpdate(translator.PushUnityEngineColor, translator.Get, translator.UpdateUnityEngineColor); translator.RegisterPushAndGetAndUpdate(translator.PushUnityEngineQuaternion, translator.Get, translator.UpdateUnityEngineQuaternion); translator.RegisterPushAndGetAndUpdate(translator.PushUnityEngineRay, translator.Get, translator.UpdateUnityEngineRay); translator.RegisterPushAndGetAndUpdate(translator.PushUnityEngineBounds, translator.Get, translator.UpdateUnityEngineBounds); translator.RegisterPushAndGetAndUpdate(translator.PushUnityEngineRay2D, translator.Get, translator.UpdateUnityEngineRay2D); translator.RegisterPushAndGetAndUpdate(translator.PushTutorialTestEnum, translator.Get, translator.UpdateTutorialTestEnum); translator.RegisterPushAndGetAndUpdate(translator.PushTutorialDerivedClassTestEnumInner, translator.Get, translator.UpdateTutorialDerivedClassTestEnumInner); } } static IniterAdderUnityEngineVector2 s_IniterAdderUnityEngineVector2_dumb_obj = new IniterAdderUnityEngineVector2(); static IniterAdderUnityEngineVector2 IniterAdderUnityEngineVector2_dumb_obj {get{return s_IniterAdderUnityEngineVector2_dumb_obj;}} int UnityEngineVector2_TypeID = -1; public void PushUnityEngineVector2(RealStatePtr L, UnityEngine.Vector2 val) { if (UnityEngineVector2_TypeID == -1) { bool is_first; UnityEngineVector2_TypeID = getTypeId(L, typeof(UnityEngine.Vector2), out is_first); } IntPtr buff = LuaAPI.xlua_pushstruct(L, 8, UnityEngineVector2_TypeID); if (!CopyByValue.Pack(buff, 0, val)) { throw new Exception("pack fail fail for UnityEngine.Vector2 ,value="+val); } } public void Get(RealStatePtr L, int index, out UnityEngine.Vector2 val) { LuaTypes type = LuaAPI.lua_type(L, index); if (type == LuaTypes.LUA_TUSERDATA ) { if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineVector2_TypeID) { throw new Exception("invalid userdata for UnityEngine.Vector2"); } IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val)) { throw new Exception("unpack fail for UnityEngine.Vector2"); } } else if (type ==LuaTypes.LUA_TTABLE) { CopyByValue.UnPack(this, L, index, out val); } else { val = (UnityEngine.Vector2)objectCasters.GetCaster(typeof(UnityEngine.Vector2))(L, index, null); } } public void UpdateUnityEngineVector2(RealStatePtr L, int index, UnityEngine.Vector2 val) { if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA) { if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineVector2_TypeID) { throw new Exception("invalid userdata for UnityEngine.Vector2"); } IntPtr buff = LuaAPI.lua_touserdata(L, index); if (!CopyByValue.Pack(buff, 0, val)) { throw new Exception("pack fail for UnityEngine.Vector2 ,value="+val); } } else { throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index)); } } int UnityEngineVector3_TypeID = -1; public void PushUnityEngineVector3(RealStatePtr L, UnityEngine.Vector3 val) { if (UnityEngineVector3_TypeID == -1) { bool is_first; UnityEngineVector3_TypeID = getTypeId(L, typeof(UnityEngine.Vector3), out is_first); } IntPtr buff = LuaAPI.xlua_pushstruct(L, 12, UnityEngineVector3_TypeID); if (!CopyByValue.Pack(buff, 0, val)) { throw new Exception("pack fail fail for UnityEngine.Vector3 ,value="+val); } } public void Get(RealStatePtr L, int index, out UnityEngine.Vector3 val) { LuaTypes type = LuaAPI.lua_type(L, index); if (type == LuaTypes.LUA_TUSERDATA ) { if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineVector3_TypeID) { throw new Exception("invalid userdata for UnityEngine.Vector3"); } IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val)) { throw new Exception("unpack fail for UnityEngine.Vector3"); } } else if (type ==LuaTypes.LUA_TTABLE) { CopyByValue.UnPack(this, L, index, out val); } else { val = (UnityEngine.Vector3)objectCasters.GetCaster(typeof(UnityEngine.Vector3))(L, index, null); } } public void UpdateUnityEngineVector3(RealStatePtr L, int index, UnityEngine.Vector3 val) { if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA) { if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineVector3_TypeID) { throw new Exception("invalid userdata for UnityEngine.Vector3"); } IntPtr buff = LuaAPI.lua_touserdata(L, index); if (!CopyByValue.Pack(buff, 0, val)) { throw new Exception("pack fail for UnityEngine.Vector3 ,value="+val); } } else { throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index)); } } int UnityEngineVector4_TypeID = -1; public void PushUnityEngineVector4(RealStatePtr L, UnityEngine.Vector4 val) { if (UnityEngineVector4_TypeID == -1) { bool is_first; UnityEngineVector4_TypeID = getTypeId(L, typeof(UnityEngine.Vector4), out is_first); } IntPtr buff = LuaAPI.xlua_pushstruct(L, 16, UnityEngineVector4_TypeID); if (!CopyByValue.Pack(buff, 0, val)) { throw new Exception("pack fail fail for UnityEngine.Vector4 ,value="+val); } } public void Get(RealStatePtr L, int index, out UnityEngine.Vector4 val) { LuaTypes type = LuaAPI.lua_type(L, index); if (type == LuaTypes.LUA_TUSERDATA ) { if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineVector4_TypeID) { throw new Exception("invalid userdata for UnityEngine.Vector4"); } IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val)) { throw new Exception("unpack fail for UnityEngine.Vector4"); } } else if (type ==LuaTypes.LUA_TTABLE) { CopyByValue.UnPack(this, L, index, out val); } else { val = (UnityEngine.Vector4)objectCasters.GetCaster(typeof(UnityEngine.Vector4))(L, index, null); } } public void UpdateUnityEngineVector4(RealStatePtr L, int index, UnityEngine.Vector4 val) { if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA) { if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineVector4_TypeID) { throw new Exception("invalid userdata for UnityEngine.Vector4"); } IntPtr buff = LuaAPI.lua_touserdata(L, index); if (!CopyByValue.Pack(buff, 0, val)) { throw new Exception("pack fail for UnityEngine.Vector4 ,value="+val); } } else { throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index)); } } int UnityEngineColor_TypeID = -1; public void PushUnityEngineColor(RealStatePtr L, UnityEngine.Color val) { if (UnityEngineColor_TypeID == -1) { bool is_first; UnityEngineColor_TypeID = getTypeId(L, typeof(UnityEngine.Color), out is_first); } IntPtr buff = LuaAPI.xlua_pushstruct(L, 16, UnityEngineColor_TypeID); if (!CopyByValue.Pack(buff, 0, val)) { throw new Exception("pack fail fail for UnityEngine.Color ,value="+val); } } public void Get(RealStatePtr L, int index, out UnityEngine.Color val) { LuaTypes type = LuaAPI.lua_type(L, index); if (type == LuaTypes.LUA_TUSERDATA ) { if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineColor_TypeID) { throw new Exception("invalid userdata for UnityEngine.Color"); } IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val)) { throw new Exception("unpack fail for UnityEngine.Color"); } } else if (type ==LuaTypes.LUA_TTABLE) { CopyByValue.UnPack(this, L, index, out val); } else { val = (UnityEngine.Color)objectCasters.GetCaster(typeof(UnityEngine.Color))(L, index, null); } } public void UpdateUnityEngineColor(RealStatePtr L, int index, UnityEngine.Color val) { if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA) { if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineColor_TypeID) { throw new Exception("invalid userdata for UnityEngine.Color"); } IntPtr buff = LuaAPI.lua_touserdata(L, index); if (!CopyByValue.Pack(buff, 0, val)) { throw new Exception("pack fail for UnityEngine.Color ,value="+val); } } else { throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index)); } } int UnityEngineQuaternion_TypeID = -1; public void PushUnityEngineQuaternion(RealStatePtr L, UnityEngine.Quaternion val) { if (UnityEngineQuaternion_TypeID == -1) { bool is_first; UnityEngineQuaternion_TypeID = getTypeId(L, typeof(UnityEngine.Quaternion), out is_first); } IntPtr buff = LuaAPI.xlua_pushstruct(L, 16, UnityEngineQuaternion_TypeID); if (!CopyByValue.Pack(buff, 0, val)) { throw new Exception("pack fail fail for UnityEngine.Quaternion ,value="+val); } } public void Get(RealStatePtr L, int index, out UnityEngine.Quaternion val) { LuaTypes type = LuaAPI.lua_type(L, index); if (type == LuaTypes.LUA_TUSERDATA ) { if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineQuaternion_TypeID) { throw new Exception("invalid userdata for UnityEngine.Quaternion"); } IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val)) { throw new Exception("unpack fail for UnityEngine.Quaternion"); } } else if (type ==LuaTypes.LUA_TTABLE) { CopyByValue.UnPack(this, L, index, out val); } else { val = (UnityEngine.Quaternion)objectCasters.GetCaster(typeof(UnityEngine.Quaternion))(L, index, null); } } public void UpdateUnityEngineQuaternion(RealStatePtr L, int index, UnityEngine.Quaternion val) { if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA) { if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineQuaternion_TypeID) { throw new Exception("invalid userdata for UnityEngine.Quaternion"); } IntPtr buff = LuaAPI.lua_touserdata(L, index); if (!CopyByValue.Pack(buff, 0, val)) { throw new Exception("pack fail for UnityEngine.Quaternion ,value="+val); } } else { throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index)); } } int UnityEngineRay_TypeID = -1; public void PushUnityEngineRay(RealStatePtr L, UnityEngine.Ray val) { if (UnityEngineRay_TypeID == -1) { bool is_first; UnityEngineRay_TypeID = getTypeId(L, typeof(UnityEngine.Ray), out is_first); } IntPtr buff = LuaAPI.xlua_pushstruct(L, 24, UnityEngineRay_TypeID); if (!CopyByValue.Pack(buff, 0, val)) { throw new Exception("pack fail fail for UnityEngine.Ray ,value="+val); } } public void Get(RealStatePtr L, int index, out UnityEngine.Ray val) { LuaTypes type = LuaAPI.lua_type(L, index); if (type == LuaTypes.LUA_TUSERDATA ) { if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineRay_TypeID) { throw new Exception("invalid userdata for UnityEngine.Ray"); } IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val)) { throw new Exception("unpack fail for UnityEngine.Ray"); } } else if (type ==LuaTypes.LUA_TTABLE) { CopyByValue.UnPack(this, L, index, out val); } else { val = (UnityEngine.Ray)objectCasters.GetCaster(typeof(UnityEngine.Ray))(L, index, null); } } public void UpdateUnityEngineRay(RealStatePtr L, int index, UnityEngine.Ray val) { if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA) { if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineRay_TypeID) { throw new Exception("invalid userdata for UnityEngine.Ray"); } IntPtr buff = LuaAPI.lua_touserdata(L, index); if (!CopyByValue.Pack(buff, 0, val)) { throw new Exception("pack fail for UnityEngine.Ray ,value="+val); } } else { throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index)); } } int UnityEngineBounds_TypeID = -1; public void PushUnityEngineBounds(RealStatePtr L, UnityEngine.Bounds val) { if (UnityEngineBounds_TypeID == -1) { bool is_first; UnityEngineBounds_TypeID = getTypeId(L, typeof(UnityEngine.Bounds), out is_first); } IntPtr buff = LuaAPI.xlua_pushstruct(L, 24, UnityEngineBounds_TypeID); if (!CopyByValue.Pack(buff, 0, val)) { throw new Exception("pack fail fail for UnityEngine.Bounds ,value="+val); } } public void Get(RealStatePtr L, int index, out UnityEngine.Bounds val) { LuaTypes type = LuaAPI.lua_type(L, index); if (type == LuaTypes.LUA_TUSERDATA ) { if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineBounds_TypeID) { throw new Exception("invalid userdata for UnityEngine.Bounds"); } IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val)) { throw new Exception("unpack fail for UnityEngine.Bounds"); } } else if (type ==LuaTypes.LUA_TTABLE) { CopyByValue.UnPack(this, L, index, out val); } else { val = (UnityEngine.Bounds)objectCasters.GetCaster(typeof(UnityEngine.Bounds))(L, index, null); } } public void UpdateUnityEngineBounds(RealStatePtr L, int index, UnityEngine.Bounds val) { if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA) { if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineBounds_TypeID) { throw new Exception("invalid userdata for UnityEngine.Bounds"); } IntPtr buff = LuaAPI.lua_touserdata(L, index); if (!CopyByValue.Pack(buff, 0, val)) { throw new Exception("pack fail for UnityEngine.Bounds ,value="+val); } } else { throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index)); } } int UnityEngineRay2D_TypeID = -1; public void PushUnityEngineRay2D(RealStatePtr L, UnityEngine.Ray2D val) { if (UnityEngineRay2D_TypeID == -1) { bool is_first; UnityEngineRay2D_TypeID = getTypeId(L, typeof(UnityEngine.Ray2D), out is_first); } IntPtr buff = LuaAPI.xlua_pushstruct(L, 16, UnityEngineRay2D_TypeID); if (!CopyByValue.Pack(buff, 0, val)) { throw new Exception("pack fail fail for UnityEngine.Ray2D ,value="+val); } } public void Get(RealStatePtr L, int index, out UnityEngine.Ray2D val) { LuaTypes type = LuaAPI.lua_type(L, index); if (type == LuaTypes.LUA_TUSERDATA ) { if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineRay2D_TypeID) { throw new Exception("invalid userdata for UnityEngine.Ray2D"); } IntPtr buff = LuaAPI.lua_touserdata(L, index);if (!CopyByValue.UnPack(buff, 0, out val)) { throw new Exception("unpack fail for UnityEngine.Ray2D"); } } else if (type ==LuaTypes.LUA_TTABLE) { CopyByValue.UnPack(this, L, index, out val); } else { val = (UnityEngine.Ray2D)objectCasters.GetCaster(typeof(UnityEngine.Ray2D))(L, index, null); } } public void UpdateUnityEngineRay2D(RealStatePtr L, int index, UnityEngine.Ray2D val) { if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA) { if (LuaAPI.xlua_gettypeid(L, index) != UnityEngineRay2D_TypeID) { throw new Exception("invalid userdata for UnityEngine.Ray2D"); } IntPtr buff = LuaAPI.lua_touserdata(L, index); if (!CopyByValue.Pack(buff, 0, val)) { throw new Exception("pack fail for UnityEngine.Ray2D ,value="+val); } } else { throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index)); } } int TutorialTestEnum_TypeID = -1; int TutorialTestEnum_EnumRef = -1; public void PushTutorialTestEnum(RealStatePtr L, Tutorial.TestEnum val) { if (TutorialTestEnum_TypeID == -1) { bool is_first; TutorialTestEnum_TypeID = getTypeId(L, typeof(Tutorial.TestEnum), out is_first); if (TutorialTestEnum_EnumRef == -1) { Utils.LoadCSTable(L, typeof(Tutorial.TestEnum)); TutorialTestEnum_EnumRef = LuaAPI.luaL_ref(L, LuaIndexes.LUA_REGISTRYINDEX); } } if (LuaAPI.xlua_tryget_cachedud(L, (int)val, TutorialTestEnum_EnumRef) == 1) { return; } IntPtr buff = LuaAPI.xlua_pushstruct(L, 4, TutorialTestEnum_TypeID); if (!CopyByValue.Pack(buff, 0, (int)val)) { throw new Exception("pack fail fail for Tutorial.TestEnum ,value="+val); } LuaAPI.lua_getref(L, TutorialTestEnum_EnumRef); LuaAPI.lua_pushvalue(L, -2); LuaAPI.xlua_rawseti(L, -2, (int)val); LuaAPI.lua_pop(L, 1); } public void Get(RealStatePtr L, int index, out Tutorial.TestEnum val) { LuaTypes type = LuaAPI.lua_type(L, index); if (type == LuaTypes.LUA_TUSERDATA ) { if (LuaAPI.xlua_gettypeid(L, index) != TutorialTestEnum_TypeID) { throw new Exception("invalid userdata for Tutorial.TestEnum"); } IntPtr buff = LuaAPI.lua_touserdata(L, index); int e; if (!CopyByValue.UnPack(buff, 0, out e)) { throw new Exception("unpack fail for Tutorial.TestEnum"); } val = (Tutorial.TestEnum)e; } else { val = (Tutorial.TestEnum)objectCasters.GetCaster(typeof(Tutorial.TestEnum))(L, index, null); } } public void UpdateTutorialTestEnum(RealStatePtr L, int index, Tutorial.TestEnum val) { if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA) { if (LuaAPI.xlua_gettypeid(L, index) != TutorialTestEnum_TypeID) { throw new Exception("invalid userdata for Tutorial.TestEnum"); } IntPtr buff = LuaAPI.lua_touserdata(L, index); if (!CopyByValue.Pack(buff, 0, (int)val)) { throw new Exception("pack fail for Tutorial.TestEnum ,value="+val); } } else { throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index)); } } int TutorialDerivedClassTestEnumInner_TypeID = -1; int TutorialDerivedClassTestEnumInner_EnumRef = -1; public void PushTutorialDerivedClassTestEnumInner(RealStatePtr L, Tutorial.DerivedClass.TestEnumInner val) { if (TutorialDerivedClassTestEnumInner_TypeID == -1) { bool is_first; TutorialDerivedClassTestEnumInner_TypeID = getTypeId(L, typeof(Tutorial.DerivedClass.TestEnumInner), out is_first); if (TutorialDerivedClassTestEnumInner_EnumRef == -1) { Utils.LoadCSTable(L, typeof(Tutorial.DerivedClass.TestEnumInner)); TutorialDerivedClassTestEnumInner_EnumRef = LuaAPI.luaL_ref(L, LuaIndexes.LUA_REGISTRYINDEX); } } if (LuaAPI.xlua_tryget_cachedud(L, (int)val, TutorialDerivedClassTestEnumInner_EnumRef) == 1) { return; } IntPtr buff = LuaAPI.xlua_pushstruct(L, 4, TutorialDerivedClassTestEnumInner_TypeID); if (!CopyByValue.Pack(buff, 0, (int)val)) { throw new Exception("pack fail fail for Tutorial.DerivedClass.TestEnumInner ,value="+val); } LuaAPI.lua_getref(L, TutorialDerivedClassTestEnumInner_EnumRef); LuaAPI.lua_pushvalue(L, -2); LuaAPI.xlua_rawseti(L, -2, (int)val); LuaAPI.lua_pop(L, 1); } public void Get(RealStatePtr L, int index, out Tutorial.DerivedClass.TestEnumInner val) { LuaTypes type = LuaAPI.lua_type(L, index); if (type == LuaTypes.LUA_TUSERDATA ) { if (LuaAPI.xlua_gettypeid(L, index) != TutorialDerivedClassTestEnumInner_TypeID) { throw new Exception("invalid userdata for Tutorial.DerivedClass.TestEnumInner"); } IntPtr buff = LuaAPI.lua_touserdata(L, index); int e; if (!CopyByValue.UnPack(buff, 0, out e)) { throw new Exception("unpack fail for Tutorial.DerivedClass.TestEnumInner"); } val = (Tutorial.DerivedClass.TestEnumInner)e; } else { val = (Tutorial.DerivedClass.TestEnumInner)objectCasters.GetCaster(typeof(Tutorial.DerivedClass.TestEnumInner))(L, index, null); } } public void UpdateTutorialDerivedClassTestEnumInner(RealStatePtr L, int index, Tutorial.DerivedClass.TestEnumInner val) { if (LuaAPI.lua_type(L, index) == LuaTypes.LUA_TUSERDATA) { if (LuaAPI.xlua_gettypeid(L, index) != TutorialDerivedClassTestEnumInner_TypeID) { throw new Exception("invalid userdata for Tutorial.DerivedClass.TestEnumInner"); } IntPtr buff = LuaAPI.lua_touserdata(L, index); if (!CopyByValue.Pack(buff, 0, (int)val)) { throw new Exception("pack fail for Tutorial.DerivedClass.TestEnumInner ,value="+val); } } else { throw new Exception("try to update a data with lua type:" + LuaAPI.lua_type(L, index)); } } // table cast optimze } public partial class StaticLuaCallbacks { internal static bool __tryArrayGet(Type type, RealStatePtr L, ObjectTranslator translator, object obj, int index) { if (type == typeof(UnityEngine.Vector2[])) { UnityEngine.Vector2[] array = obj as UnityEngine.Vector2[]; translator.PushUnityEngineVector2(L, array[index]); return true; } else if (type == typeof(UnityEngine.Vector3[])) { UnityEngine.Vector3[] array = obj as UnityEngine.Vector3[]; translator.PushUnityEngineVector3(L, array[index]); return true; } else if (type == typeof(UnityEngine.Vector4[])) { UnityEngine.Vector4[] array = obj as UnityEngine.Vector4[]; translator.PushUnityEngineVector4(L, array[index]); return true; } else if (type == typeof(UnityEngine.Color[])) { UnityEngine.Color[] array = obj as UnityEngine.Color[]; translator.PushUnityEngineColor(L, array[index]); return true; } else if (type == typeof(UnityEngine.Quaternion[])) { UnityEngine.Quaternion[] array = obj as UnityEngine.Quaternion[]; translator.PushUnityEngineQuaternion(L, array[index]); return true; } else if (type == typeof(UnityEngine.Ray[])) { UnityEngine.Ray[] array = obj as UnityEngine.Ray[]; translator.PushUnityEngineRay(L, array[index]); return true; } else if (type == typeof(UnityEngine.Bounds[])) { UnityEngine.Bounds[] array = obj as UnityEngine.Bounds[]; translator.PushUnityEngineBounds(L, array[index]); return true; } else if (type == typeof(UnityEngine.Ray2D[])) { UnityEngine.Ray2D[] array = obj as UnityEngine.Ray2D[]; translator.PushUnityEngineRay2D(L, array[index]); return true; } else if (type == typeof(Tutorial.TestEnum[])) { Tutorial.TestEnum[] array = obj as Tutorial.TestEnum[]; translator.PushTutorialTestEnum(L, array[index]); return true; } else if (type == typeof(Tutorial.DerivedClass.TestEnumInner[])) { Tutorial.DerivedClass.TestEnumInner[] array = obj as Tutorial.DerivedClass.TestEnumInner[]; translator.PushTutorialDerivedClassTestEnumInner(L, array[index]); return true; } return false; } internal static bool __tryArraySet(Type type, RealStatePtr L, ObjectTranslator translator, object obj, int array_idx, int obj_idx) { if (type == typeof(UnityEngine.Vector2[])) { UnityEngine.Vector2[] array = obj as UnityEngine.Vector2[]; translator.Get(L, obj_idx, out array[array_idx]); return true; } else if (type == typeof(UnityEngine.Vector3[])) { UnityEngine.Vector3[] array = obj as UnityEngine.Vector3[]; translator.Get(L, obj_idx, out array[array_idx]); return true; } else if (type == typeof(UnityEngine.Vector4[])) { UnityEngine.Vector4[] array = obj as UnityEngine.Vector4[]; translator.Get(L, obj_idx, out array[array_idx]); return true; } else if (type == typeof(UnityEngine.Color[])) { UnityEngine.Color[] array = obj as UnityEngine.Color[]; translator.Get(L, obj_idx, out array[array_idx]); return true; } else if (type == typeof(UnityEngine.Quaternion[])) { UnityEngine.Quaternion[] array = obj as UnityEngine.Quaternion[]; translator.Get(L, obj_idx, out array[array_idx]); return true; } else if (type == typeof(UnityEngine.Ray[])) { UnityEngine.Ray[] array = obj as UnityEngine.Ray[]; translator.Get(L, obj_idx, out array[array_idx]); return true; } else if (type == typeof(UnityEngine.Bounds[])) { UnityEngine.Bounds[] array = obj as UnityEngine.Bounds[]; translator.Get(L, obj_idx, out array[array_idx]); return true; } else if (type == typeof(UnityEngine.Ray2D[])) { UnityEngine.Ray2D[] array = obj as UnityEngine.Ray2D[]; translator.Get(L, obj_idx, out array[array_idx]); return true; } else if (type == typeof(Tutorial.TestEnum[])) { Tutorial.TestEnum[] array = obj as Tutorial.TestEnum[]; translator.Get(L, obj_idx, out array[array_idx]); return true; } else if (type == typeof(Tutorial.DerivedClass.TestEnumInner[])) { Tutorial.DerivedClass.TestEnumInner[] array = obj as Tutorial.DerivedClass.TestEnumInner[]; translator.Get(L, obj_idx, out array[array_idx]); return true; } return false; } } }