Esempio n. 1
0
    static int LoadPrefab(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.GameObject o    = obj.LoadPrefab(arg0);
                ToLua.PushSealed(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.GameObject o    = obj.LoadPrefab(arg0, arg1);
                ToLua.PushSealed(L, o);
                return(1);
            }
            else if (count == 4)
            {
                ResModuleUtility       obj  = (ResModuleUtility)ToLua.CheckObject <ResModuleUtility>(L, 1);
                string                 arg0 = ToLua.CheckString(L, 2);
                bool                   arg1 = LuaDLL.luaL_checkboolean(L, 3);
                bool                   arg2 = LuaDLL.luaL_checkboolean(L, 4);
                UnityEngine.GameObject o    = obj.LoadPrefab(arg0, arg1, arg2);
                ToLua.PushSealed(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: ResModuleUtility.LoadPrefab"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Esempio n. 2
0
 public GameObject GetPrefab(string resName, bool instantiate = false, bool isTry = false)
 {
     return(resUtility.LoadPrefab(resName, instantiate, isTry));
 }