Exemplo n.º 1
0
    static int LoadMaterial(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                ResModuleUtility     obj  = (ResModuleUtility)ToLua.CheckObject <ResModuleUtility>(L, 1);
                string               arg0 = ToLua.CheckString(L, 2);
                UnityEngine.Material o    = obj.LoadMaterial(arg0);
                ToLua.Push(L, o);
                return(1);
            }
            else if (count == 3)
            {
                ResModuleUtility     obj  = (ResModuleUtility)ToLua.CheckObject <ResModuleUtility>(L, 1);
                string               arg0 = ToLua.CheckString(L, 2);
                bool                 arg1 = LuaDLL.luaL_checkboolean(L, 3);
                UnityEngine.Material o    = obj.LoadMaterial(arg0, arg1);
                ToLua.Push(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: ResModuleUtility.LoadMaterial"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Exemplo n.º 2
0
 public Material GetMaterial(string resName, bool isTry = false)
 {
     return(resUtility.LoadMaterial(resName, isTry));
 }