| New file |
| | |
| | | #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 XLua; |
| | | using System.Collections.Generic; |
| | | |
| | | |
| | | namespace XLua.CSObjectWrap |
| | | { |
| | | using Utils = XLua.Utils; |
| | | public class UnityEngineColorWrap |
| | | { |
| | | public static void __Register(RealStatePtr L) |
| | | { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | System.Type type = typeof(UnityEngine.Color); |
| | | Utils.BeginObjectRegister(type, L, translator, 5, 3, 8, 4); |
| | | Utils.RegisterFunc(L, Utils.OBJ_META_IDX, "__add", __AddMeta); |
| | | Utils.RegisterFunc(L, Utils.OBJ_META_IDX, "__sub", __SubMeta); |
| | | Utils.RegisterFunc(L, Utils.OBJ_META_IDX, "__mul", __MulMeta); |
| | | Utils.RegisterFunc(L, Utils.OBJ_META_IDX, "__div", __DivMeta); |
| | | Utils.RegisterFunc(L, Utils.OBJ_META_IDX, "__eq", __EqMeta); |
| | | |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "ToString", _m_ToString); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetHashCode", _m_GetHashCode); |
| | | Utils.RegisterFunc(L, Utils.METHOD_IDX, "Equals", _m_Equals); |
| | | |
| | | |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "grayscale", _g_get_grayscale); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "linear", _g_get_linear); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "gamma", _g_get_gamma); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "maxColorComponent", _g_get_maxColorComponent); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "r", _g_get_r); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "g", _g_get_g); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "b", _g_get_b); |
| | | Utils.RegisterFunc(L, Utils.GETTER_IDX, "a", _g_get_a); |
| | | |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "r", _s_set_r); |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "g", _s_set_g); |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "b", _s_set_b); |
| | | Utils.RegisterFunc(L, Utils.SETTER_IDX, "a", _s_set_a); |
| | | |
| | | |
| | | Utils.EndObjectRegister(type, L, translator, __CSIndexer, __NewIndexer, |
| | | null, null, null); |
| | | |
| | | Utils.BeginClassRegister(type, L, __CreateInstance, 5, 11, 0); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "Lerp", _m_Lerp_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "LerpUnclamped", _m_LerpUnclamped_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "RGBToHSV", _m_RGBToHSV_xlua_st_); |
| | | Utils.RegisterFunc(L, Utils.CLS_IDX, "HSVToRGB", _m_HSVToRGB_xlua_st_); |
| | | |
| | | |
| | | |
| | | Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "red", _g_get_red); |
| | | Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "green", _g_get_green); |
| | | Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "blue", _g_get_blue); |
| | | Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "white", _g_get_white); |
| | | Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "black", _g_get_black); |
| | | Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "yellow", _g_get_yellow); |
| | | Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "cyan", _g_get_cyan); |
| | | Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "magenta", _g_get_magenta); |
| | | Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "gray", _g_get_gray); |
| | | Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "grey", _g_get_grey); |
| | | Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "clear", _g_get_clear); |
| | | |
| | | |
| | | |
| | | Utils.EndClassRegister(type, L, translator); |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int __CreateInstance(RealStatePtr L) |
| | | { |
| | | |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | if(LuaAPI.lua_gettop(L) == 5 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 5)) |
| | | { |
| | | float _r = (float)LuaAPI.lua_tonumber(L, 2); |
| | | float _g = (float)LuaAPI.lua_tonumber(L, 3); |
| | | float _b = (float)LuaAPI.lua_tonumber(L, 4); |
| | | float _a = (float)LuaAPI.lua_tonumber(L, 5); |
| | | |
| | | UnityEngine.Color gen_ret = new UnityEngine.Color(_r, _g, _b, _a); |
| | | translator.PushUnityEngineColor(L, gen_ret); |
| | | |
| | | return 1; |
| | | } |
| | | if(LuaAPI.lua_gettop(L) == 4 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4)) |
| | | { |
| | | float _r = (float)LuaAPI.lua_tonumber(L, 2); |
| | | float _g = (float)LuaAPI.lua_tonumber(L, 3); |
| | | float _b = (float)LuaAPI.lua_tonumber(L, 4); |
| | | |
| | | UnityEngine.Color gen_ret = new UnityEngine.Color(_r, _g, _b); |
| | | translator.PushUnityEngineColor(L, gen_ret); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | if (LuaAPI.lua_gettop(L) == 1) |
| | | { |
| | | translator.PushUnityEngineColor(L, default(UnityEngine.Color)); |
| | | return 1; |
| | | } |
| | | |
| | | } |
| | | catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Color constructor!"); |
| | | |
| | | } |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | public static int __CSIndexer(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | if (translator.Assignable<UnityEngine.Color>(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) |
| | | { |
| | | |
| | | UnityEngine.Color gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | int index = LuaAPI.xlua_tointeger(L, 2); |
| | | LuaAPI.lua_pushboolean(L, true); |
| | | LuaAPI.lua_pushnumber(L, gen_to_be_invoked[index]); |
| | | return 2; |
| | | } |
| | | |
| | | } |
| | | catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | LuaAPI.lua_pushboolean(L, false); |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | public static int __NewIndexer(RealStatePtr L) |
| | | { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | try { |
| | | |
| | | if (translator.Assignable<UnityEngine.Color>(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) |
| | | { |
| | | |
| | | UnityEngine.Color gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | int key = LuaAPI.xlua_tointeger(L, 2); |
| | | gen_to_be_invoked[key] = (float)LuaAPI.lua_tonumber(L, 3); |
| | | LuaAPI.lua_pushboolean(L, true); |
| | | return 1; |
| | | } |
| | | |
| | | } |
| | | catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | LuaAPI.lua_pushboolean(L, false); |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int __AddMeta(RealStatePtr L) |
| | | { |
| | | |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | if (translator.Assignable<UnityEngine.Color>(L, 1) && translator.Assignable<UnityEngine.Color>(L, 2)) |
| | | { |
| | | UnityEngine.Color leftside;translator.Get(L, 1, out leftside); |
| | | UnityEngine.Color rightside;translator.Get(L, 2, out rightside); |
| | | |
| | | translator.PushUnityEngineColor(L, leftside + rightside); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } |
| | | catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return LuaAPI.luaL_error(L, "invalid arguments to right hand of + operator, need UnityEngine.Color!"); |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int __SubMeta(RealStatePtr L) |
| | | { |
| | | |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | if (translator.Assignable<UnityEngine.Color>(L, 1) && translator.Assignable<UnityEngine.Color>(L, 2)) |
| | | { |
| | | UnityEngine.Color leftside;translator.Get(L, 1, out leftside); |
| | | UnityEngine.Color rightside;translator.Get(L, 2, out rightside); |
| | | |
| | | translator.PushUnityEngineColor(L, leftside - rightside); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } |
| | | catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return LuaAPI.luaL_error(L, "invalid arguments to right hand of - operator, need UnityEngine.Color!"); |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int __MulMeta(RealStatePtr L) |
| | | { |
| | | |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | if (translator.Assignable<UnityEngine.Color>(L, 1) && translator.Assignable<UnityEngine.Color>(L, 2)) |
| | | { |
| | | UnityEngine.Color leftside;translator.Get(L, 1, out leftside); |
| | | UnityEngine.Color rightside;translator.Get(L, 2, out rightside); |
| | | |
| | | translator.PushUnityEngineColor(L, leftside * rightside); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | if (translator.Assignable<UnityEngine.Color>(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) |
| | | { |
| | | UnityEngine.Color leftside;translator.Get(L, 1, out leftside); |
| | | float rightside = (float)LuaAPI.lua_tonumber(L, 2); |
| | | |
| | | translator.PushUnityEngineColor(L, leftside * rightside); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | if (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) && translator.Assignable<UnityEngine.Color>(L, 2)) |
| | | { |
| | | float leftside = (float)LuaAPI.lua_tonumber(L, 1); |
| | | UnityEngine.Color rightside;translator.Get(L, 2, out rightside); |
| | | |
| | | translator.PushUnityEngineColor(L, leftside * rightside); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } |
| | | catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return LuaAPI.luaL_error(L, "invalid arguments to right hand of * operator, need UnityEngine.Color!"); |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int __DivMeta(RealStatePtr L) |
| | | { |
| | | |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | if (translator.Assignable<UnityEngine.Color>(L, 1) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) |
| | | { |
| | | UnityEngine.Color leftside;translator.Get(L, 1, out leftside); |
| | | float rightside = (float)LuaAPI.lua_tonumber(L, 2); |
| | | |
| | | translator.PushUnityEngineColor(L, leftside / rightside); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } |
| | | catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return LuaAPI.luaL_error(L, "invalid arguments to right hand of / operator, need UnityEngine.Color!"); |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int __EqMeta(RealStatePtr L) |
| | | { |
| | | |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | if (translator.Assignable<UnityEngine.Color>(L, 1) && translator.Assignable<UnityEngine.Color>(L, 2)) |
| | | { |
| | | UnityEngine.Color leftside;translator.Get(L, 1, out leftside); |
| | | UnityEngine.Color rightside;translator.Get(L, 2, out rightside); |
| | | |
| | | LuaAPI.lua_pushboolean(L, leftside == rightside); |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } |
| | | catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return LuaAPI.luaL_error(L, "invalid arguments to right hand of == operator, need UnityEngine.Color!"); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_ToString(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | UnityEngine.Color gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | |
| | | |
| | | int gen_param_count = LuaAPI.lua_gettop(L); |
| | | |
| | | if(gen_param_count == 1) |
| | | { |
| | | |
| | | string gen_ret = gen_to_be_invoked.ToString( ); |
| | | LuaAPI.lua_pushstring(L, gen_ret); |
| | | |
| | | |
| | | translator.UpdateUnityEngineColor(L, 1, gen_to_be_invoked); |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)) |
| | | { |
| | | string _format = LuaAPI.lua_tostring(L, 2); |
| | | |
| | | string gen_ret = gen_to_be_invoked.ToString( _format ); |
| | | LuaAPI.lua_pushstring(L, gen_ret); |
| | | |
| | | |
| | | translator.UpdateUnityEngineColor(L, 1, gen_to_be_invoked); |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Color.ToString!"); |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_GetHashCode(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | UnityEngine.Color gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | |
| | | |
| | | |
| | | { |
| | | |
| | | int gen_ret = gen_to_be_invoked.GetHashCode( ); |
| | | LuaAPI.xlua_pushinteger(L, gen_ret); |
| | | |
| | | |
| | | translator.UpdateUnityEngineColor(L, 1, gen_to_be_invoked); |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_Equals(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | UnityEngine.Color gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | |
| | | |
| | | |
| | | { |
| | | object _other = translator.GetObject(L, 2, typeof(object)); |
| | | |
| | | bool gen_ret = gen_to_be_invoked.Equals( _other ); |
| | | LuaAPI.lua_pushboolean(L, gen_ret); |
| | | |
| | | |
| | | translator.UpdateUnityEngineColor(L, 1, gen_to_be_invoked); |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_Lerp_xlua_st_(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | |
| | | |
| | | { |
| | | UnityEngine.Color _a;translator.Get(L, 1, out _a); |
| | | UnityEngine.Color _b;translator.Get(L, 2, out _b); |
| | | float _t = (float)LuaAPI.lua_tonumber(L, 3); |
| | | |
| | | UnityEngine.Color gen_ret = UnityEngine.Color.Lerp( _a, _b, _t ); |
| | | translator.PushUnityEngineColor(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_LerpUnclamped_xlua_st_(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | |
| | | |
| | | { |
| | | UnityEngine.Color _a;translator.Get(L, 1, out _a); |
| | | UnityEngine.Color _b;translator.Get(L, 2, out _b); |
| | | float _t = (float)LuaAPI.lua_tonumber(L, 3); |
| | | |
| | | UnityEngine.Color gen_ret = UnityEngine.Color.LerpUnclamped( _a, _b, _t ); |
| | | translator.PushUnityEngineColor(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_RGBToHSV_xlua_st_(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | |
| | | |
| | | { |
| | | UnityEngine.Color _rgbColor;translator.Get(L, 1, out _rgbColor); |
| | | float _H; |
| | | float _S; |
| | | float _V; |
| | | |
| | | UnityEngine.Color.RGBToHSV( _rgbColor, out _H, out _S, out _V ); |
| | | LuaAPI.lua_pushnumber(L, _H); |
| | | |
| | | LuaAPI.lua_pushnumber(L, _S); |
| | | |
| | | LuaAPI.lua_pushnumber(L, _V); |
| | | |
| | | |
| | | |
| | | |
| | | return 3; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _m_HSVToRGB_xlua_st_(RealStatePtr L) |
| | | { |
| | | try { |
| | | |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | |
| | | |
| | | int gen_param_count = LuaAPI.lua_gettop(L); |
| | | |
| | | if(gen_param_count == 3&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) |
| | | { |
| | | float _H = (float)LuaAPI.lua_tonumber(L, 1); |
| | | float _S = (float)LuaAPI.lua_tonumber(L, 2); |
| | | float _V = (float)LuaAPI.lua_tonumber(L, 3); |
| | | |
| | | UnityEngine.Color gen_ret = UnityEngine.Color.HSVToRGB( _H, _S, _V ); |
| | | translator.PushUnityEngineColor(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | if(gen_param_count == 4&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)&& LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 4)) |
| | | { |
| | | float _H = (float)LuaAPI.lua_tonumber(L, 1); |
| | | float _S = (float)LuaAPI.lua_tonumber(L, 2); |
| | | float _V = (float)LuaAPI.lua_tonumber(L, 3); |
| | | bool _hdr = LuaAPI.lua_toboolean(L, 4); |
| | | |
| | | UnityEngine.Color gen_ret = UnityEngine.Color.HSVToRGB( _H, _S, _V, _hdr ); |
| | | translator.PushUnityEngineColor(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | |
| | | return LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Color.HSVToRGB!"); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_red(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | translator.PushUnityEngineColor(L, UnityEngine.Color.red); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_green(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | translator.PushUnityEngineColor(L, UnityEngine.Color.green); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_blue(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | translator.PushUnityEngineColor(L, UnityEngine.Color.blue); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_white(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | translator.PushUnityEngineColor(L, UnityEngine.Color.white); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_black(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | translator.PushUnityEngineColor(L, UnityEngine.Color.black); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_yellow(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | translator.PushUnityEngineColor(L, UnityEngine.Color.yellow); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_cyan(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | translator.PushUnityEngineColor(L, UnityEngine.Color.cyan); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_magenta(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | translator.PushUnityEngineColor(L, UnityEngine.Color.magenta); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_gray(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | translator.PushUnityEngineColor(L, UnityEngine.Color.gray); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_grey(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | translator.PushUnityEngineColor(L, UnityEngine.Color.grey); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_clear(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | translator.PushUnityEngineColor(L, UnityEngine.Color.clear); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_grayscale(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | UnityEngine.Color gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | LuaAPI.lua_pushnumber(L, gen_to_be_invoked.grayscale); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_linear(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | UnityEngine.Color gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | translator.PushUnityEngineColor(L, gen_to_be_invoked.linear); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_gamma(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | UnityEngine.Color gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | translator.PushUnityEngineColor(L, gen_to_be_invoked.gamma); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_maxColorComponent(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | UnityEngine.Color gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | LuaAPI.lua_pushnumber(L, gen_to_be_invoked.maxColorComponent); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_r(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | UnityEngine.Color gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | LuaAPI.lua_pushnumber(L, gen_to_be_invoked.r); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_g(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | UnityEngine.Color gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | LuaAPI.lua_pushnumber(L, gen_to_be_invoked.g); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_b(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | UnityEngine.Color gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | LuaAPI.lua_pushnumber(L, gen_to_be_invoked.b); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _g_get_a(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | UnityEngine.Color gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | LuaAPI.lua_pushnumber(L, gen_to_be_invoked.a); |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _s_set_r(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | UnityEngine.Color gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | gen_to_be_invoked.r = (float)LuaAPI.lua_tonumber(L, 2); |
| | | |
| | | translator.UpdateUnityEngineColor(L, 1, gen_to_be_invoked); |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _s_set_g(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | UnityEngine.Color gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | gen_to_be_invoked.g = (float)LuaAPI.lua_tonumber(L, 2); |
| | | |
| | | translator.UpdateUnityEngineColor(L, 1, gen_to_be_invoked); |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _s_set_b(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | UnityEngine.Color gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | gen_to_be_invoked.b = (float)LuaAPI.lua_tonumber(L, 2); |
| | | |
| | | translator.UpdateUnityEngineColor(L, 1, gen_to_be_invoked); |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] |
| | | static int _s_set_a(RealStatePtr L) |
| | | { |
| | | try { |
| | | ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); |
| | | |
| | | UnityEngine.Color gen_to_be_invoked;translator.Get(L, 1, out gen_to_be_invoked); |
| | | gen_to_be_invoked.a = (float)LuaAPI.lua_tonumber(L, 2); |
| | | |
| | | translator.UpdateUnityEngineColor(L, 1, gen_to_be_invoked); |
| | | |
| | | } catch(System.Exception gen_e) { |
| | | return LuaAPI.luaL_error(L, "c# exception:" + gen_e); |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |