Esempio n. 1
0
    static int GetSprite(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                UIMod              obj  = (UIMod)ToLua.CheckObject <UIMod>(L, 1);
                string             arg0 = ToLua.CheckString(L, 2);
                UnityEngine.Sprite o    = obj.GetSprite(arg0);
                ToLua.PushSealed(L, o);
                return(1);
            }
            else if (count == 3)
            {
                UIMod              obj  = (UIMod)ToLua.CheckObject <UIMod>(L, 1);
                string             arg0 = ToLua.CheckString(L, 2);
                bool               arg1 = LuaDLL.luaL_checkboolean(L, 3);
                UnityEngine.Sprite o    = obj.GetSprite(arg0, arg1);
                ToLua.PushSealed(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: UIMod.GetSprite"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }