960 lines
38 KiB
C#
960 lines
38 KiB
C#
#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 UnityEngineAssetBundleWrap
|
|
{
|
|
public static void __Register(RealStatePtr L)
|
|
{
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
System.Type type = typeof(UnityEngine.AssetBundle);
|
|
Utils.BeginObjectRegister(type, L, translator, 0, 11, 1, 0);
|
|
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Contains", _m_Contains);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "LoadAsset", _m_LoadAsset);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "LoadAssetAsync", _m_LoadAssetAsync);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "LoadAssetWithSubAssets", _m_LoadAssetWithSubAssets);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "LoadAssetWithSubAssetsAsync", _m_LoadAssetWithSubAssetsAsync);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "LoadAllAssets", _m_LoadAllAssets);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "LoadAllAssetsAsync", _m_LoadAllAssetsAsync);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "Unload", _m_Unload);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "UnloadAsync", _m_UnloadAsync);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetAllAssetNames", _m_GetAllAssetNames);
|
|
Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetAllScenePaths", _m_GetAllScenePaths);
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.GETTER_IDX, "isStreamedSceneAssetBundle", _g_get_isStreamedSceneAssetBundle);
|
|
|
|
|
|
|
|
Utils.EndObjectRegister(type, L, translator, null, null,
|
|
null, null, null);
|
|
|
|
Utils.BeginClassRegister(type, L, __CreateInstance, 10, 1, 1);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "UnloadAllAssetBundles", _m_UnloadAllAssetBundles_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "GetAllLoadedAssetBundles", _m_GetAllLoadedAssetBundles_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "LoadFromFileAsync", _m_LoadFromFileAsync_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "LoadFromFile", _m_LoadFromFile_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "LoadFromMemoryAsync", _m_LoadFromMemoryAsync_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "LoadFromMemory", _m_LoadFromMemory_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "LoadFromStreamAsync", _m_LoadFromStreamAsync_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "LoadFromStream", _m_LoadFromStream_xlua_st_);
|
|
Utils.RegisterFunc(L, Utils.CLS_IDX, "RecompressAssetBundleAsync", _m_RecompressAssetBundleAsync_xlua_st_);
|
|
|
|
|
|
|
|
Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "memoryBudgetKB", _g_get_memoryBudgetKB);
|
|
|
|
Utils.RegisterFunc(L, Utils.CLS_SETTER_IDX, "memoryBudgetKB", _s_set_memoryBudgetKB);
|
|
|
|
|
|
Utils.EndClassRegister(type, L, translator);
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int __CreateInstance(RealStatePtr L)
|
|
{
|
|
return LuaAPI.luaL_error(L, "UnityEngine.AssetBundle does not have a constructor!");
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_UnloadAllAssetBundles_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
|
|
|
|
|
|
{
|
|
bool _unloadAllObjects = LuaAPI.lua_toboolean(L, 1);
|
|
|
|
UnityEngine.AssetBundle.UnloadAllAssetBundles( _unloadAllObjects );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_GetAllLoadedAssetBundles_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
var gen_ret = UnityEngine.AssetBundle.GetAllLoadedAssetBundles( );
|
|
translator.PushAny(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_LoadFromFileAsync_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
|
|
if(gen_param_count == 1&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING))
|
|
{
|
|
string _path = LuaAPI.lua_tostring(L, 1);
|
|
|
|
var gen_ret = UnityEngine.AssetBundle.LoadFromFileAsync( _path );
|
|
translator.Push(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
|
|
{
|
|
string _path = LuaAPI.lua_tostring(L, 1);
|
|
uint _crc = LuaAPI.xlua_touint(L, 2);
|
|
|
|
var gen_ret = UnityEngine.AssetBundle.LoadFromFileAsync( _path, _crc );
|
|
translator.Push(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) || LuaAPI.lua_isuint64(L, 3)))
|
|
{
|
|
string _path = LuaAPI.lua_tostring(L, 1);
|
|
uint _crc = LuaAPI.xlua_touint(L, 2);
|
|
ulong _offset = LuaAPI.lua_touint64(L, 3);
|
|
|
|
var gen_ret = UnityEngine.AssetBundle.LoadFromFileAsync( _path, _crc, _offset );
|
|
translator.Push(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.AssetBundle.LoadFromFileAsync!");
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_LoadFromFile_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
|
|
if(gen_param_count == 1&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING))
|
|
{
|
|
string _path = LuaAPI.lua_tostring(L, 1);
|
|
|
|
var gen_ret = UnityEngine.AssetBundle.LoadFromFile( _path );
|
|
translator.Push(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
|
|
{
|
|
string _path = LuaAPI.lua_tostring(L, 1);
|
|
uint _crc = LuaAPI.xlua_touint(L, 2);
|
|
|
|
var gen_ret = UnityEngine.AssetBundle.LoadFromFile( _path, _crc );
|
|
translator.Push(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& (LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) || LuaAPI.lua_isuint64(L, 3)))
|
|
{
|
|
string _path = LuaAPI.lua_tostring(L, 1);
|
|
uint _crc = LuaAPI.xlua_touint(L, 2);
|
|
ulong _offset = LuaAPI.lua_touint64(L, 3);
|
|
|
|
var gen_ret = UnityEngine.AssetBundle.LoadFromFile( _path, _crc, _offset );
|
|
translator.Push(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.AssetBundle.LoadFromFile!");
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_LoadFromMemoryAsync_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
|
|
if(gen_param_count == 1&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING))
|
|
{
|
|
byte[] _binary = LuaAPI.lua_tobytes(L, 1);
|
|
|
|
var gen_ret = UnityEngine.AssetBundle.LoadFromMemoryAsync( _binary );
|
|
translator.Push(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
|
|
{
|
|
byte[] _binary = LuaAPI.lua_tobytes(L, 1);
|
|
uint _crc = LuaAPI.xlua_touint(L, 2);
|
|
|
|
var gen_ret = UnityEngine.AssetBundle.LoadFromMemoryAsync( _binary, _crc );
|
|
translator.Push(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.AssetBundle.LoadFromMemoryAsync!");
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_LoadFromMemory_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
|
|
if(gen_param_count == 1&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING))
|
|
{
|
|
byte[] _binary = LuaAPI.lua_tobytes(L, 1);
|
|
|
|
var gen_ret = UnityEngine.AssetBundle.LoadFromMemory( _binary );
|
|
translator.Push(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
|
|
{
|
|
byte[] _binary = LuaAPI.lua_tobytes(L, 1);
|
|
uint _crc = LuaAPI.xlua_touint(L, 2);
|
|
|
|
var gen_ret = UnityEngine.AssetBundle.LoadFromMemory( _binary, _crc );
|
|
translator.Push(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.AssetBundle.LoadFromMemory!");
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_LoadFromStreamAsync_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
|
|
if(gen_param_count == 1&& translator.Assignable<System.IO.Stream>(L, 1))
|
|
{
|
|
System.IO.Stream _stream = (System.IO.Stream)translator.GetObject(L, 1, typeof(System.IO.Stream));
|
|
|
|
var gen_ret = UnityEngine.AssetBundle.LoadFromStreamAsync( _stream );
|
|
translator.Push(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
if(gen_param_count == 2&& translator.Assignable<System.IO.Stream>(L, 1)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
|
|
{
|
|
System.IO.Stream _stream = (System.IO.Stream)translator.GetObject(L, 1, typeof(System.IO.Stream));
|
|
uint _crc = LuaAPI.xlua_touint(L, 2);
|
|
|
|
var gen_ret = UnityEngine.AssetBundle.LoadFromStreamAsync( _stream, _crc );
|
|
translator.Push(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
if(gen_param_count == 3&& translator.Assignable<System.IO.Stream>(L, 1)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3))
|
|
{
|
|
System.IO.Stream _stream = (System.IO.Stream)translator.GetObject(L, 1, typeof(System.IO.Stream));
|
|
uint _crc = LuaAPI.xlua_touint(L, 2);
|
|
uint _managedReadBufferSize = LuaAPI.xlua_touint(L, 3);
|
|
|
|
var gen_ret = UnityEngine.AssetBundle.LoadFromStreamAsync( _stream, _crc, _managedReadBufferSize );
|
|
translator.Push(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.AssetBundle.LoadFromStreamAsync!");
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_LoadFromStream_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
|
|
if(gen_param_count == 1&& translator.Assignable<System.IO.Stream>(L, 1))
|
|
{
|
|
System.IO.Stream _stream = (System.IO.Stream)translator.GetObject(L, 1, typeof(System.IO.Stream));
|
|
|
|
var gen_ret = UnityEngine.AssetBundle.LoadFromStream( _stream );
|
|
translator.Push(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
if(gen_param_count == 2&& translator.Assignable<System.IO.Stream>(L, 1)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
|
|
{
|
|
System.IO.Stream _stream = (System.IO.Stream)translator.GetObject(L, 1, typeof(System.IO.Stream));
|
|
uint _crc = LuaAPI.xlua_touint(L, 2);
|
|
|
|
var gen_ret = UnityEngine.AssetBundle.LoadFromStream( _stream, _crc );
|
|
translator.Push(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
if(gen_param_count == 3&& translator.Assignable<System.IO.Stream>(L, 1)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3))
|
|
{
|
|
System.IO.Stream _stream = (System.IO.Stream)translator.GetObject(L, 1, typeof(System.IO.Stream));
|
|
uint _crc = LuaAPI.xlua_touint(L, 2);
|
|
uint _managedReadBufferSize = LuaAPI.xlua_touint(L, 3);
|
|
|
|
var gen_ret = UnityEngine.AssetBundle.LoadFromStream( _stream, _crc, _managedReadBufferSize );
|
|
translator.Push(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.AssetBundle.LoadFromStream!");
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_Contains(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
UnityEngine.AssetBundle gen_to_be_invoked = (UnityEngine.AssetBundle)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
string _name = LuaAPI.lua_tostring(L, 2);
|
|
|
|
var gen_ret = gen_to_be_invoked.Contains( _name );
|
|
LuaAPI.lua_pushboolean(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_LoadAsset(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
UnityEngine.AssetBundle gen_to_be_invoked = (UnityEngine.AssetBundle)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
|
|
if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
|
|
{
|
|
string _name = LuaAPI.lua_tostring(L, 2);
|
|
|
|
var gen_ret = gen_to_be_invoked.LoadAsset( _name );
|
|
translator.Push(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& translator.Assignable<System.Type>(L, 3))
|
|
{
|
|
string _name = LuaAPI.lua_tostring(L, 2);
|
|
System.Type _type = (System.Type)translator.GetObject(L, 3, typeof(System.Type));
|
|
|
|
var gen_ret = gen_to_be_invoked.LoadAsset( _name, _type );
|
|
translator.Push(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.AssetBundle.LoadAsset!");
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_LoadAssetAsync(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
UnityEngine.AssetBundle gen_to_be_invoked = (UnityEngine.AssetBundle)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
|
|
if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
|
|
{
|
|
string _name = LuaAPI.lua_tostring(L, 2);
|
|
|
|
var gen_ret = gen_to_be_invoked.LoadAssetAsync( _name );
|
|
translator.Push(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& translator.Assignable<System.Type>(L, 3))
|
|
{
|
|
string _name = LuaAPI.lua_tostring(L, 2);
|
|
System.Type _type = (System.Type)translator.GetObject(L, 3, typeof(System.Type));
|
|
|
|
var gen_ret = gen_to_be_invoked.LoadAssetAsync( _name, _type );
|
|
translator.Push(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.AssetBundle.LoadAssetAsync!");
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_LoadAssetWithSubAssets(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
UnityEngine.AssetBundle gen_to_be_invoked = (UnityEngine.AssetBundle)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
|
|
if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
|
|
{
|
|
string _name = LuaAPI.lua_tostring(L, 2);
|
|
|
|
var gen_ret = gen_to_be_invoked.LoadAssetWithSubAssets( _name );
|
|
translator.Push(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& translator.Assignable<System.Type>(L, 3))
|
|
{
|
|
string _name = LuaAPI.lua_tostring(L, 2);
|
|
System.Type _type = (System.Type)translator.GetObject(L, 3, typeof(System.Type));
|
|
|
|
var gen_ret = gen_to_be_invoked.LoadAssetWithSubAssets( _name, _type );
|
|
translator.Push(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.AssetBundle.LoadAssetWithSubAssets!");
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_LoadAssetWithSubAssetsAsync(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
UnityEngine.AssetBundle gen_to_be_invoked = (UnityEngine.AssetBundle)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
|
|
if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING))
|
|
{
|
|
string _name = LuaAPI.lua_tostring(L, 2);
|
|
|
|
var gen_ret = gen_to_be_invoked.LoadAssetWithSubAssetsAsync( _name );
|
|
translator.Push(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& translator.Assignable<System.Type>(L, 3))
|
|
{
|
|
string _name = LuaAPI.lua_tostring(L, 2);
|
|
System.Type _type = (System.Type)translator.GetObject(L, 3, typeof(System.Type));
|
|
|
|
var gen_ret = gen_to_be_invoked.LoadAssetWithSubAssetsAsync( _name, _type );
|
|
translator.Push(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.AssetBundle.LoadAssetWithSubAssetsAsync!");
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_LoadAllAssets(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
UnityEngine.AssetBundle gen_to_be_invoked = (UnityEngine.AssetBundle)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
|
|
if(gen_param_count == 1)
|
|
{
|
|
|
|
var gen_ret = gen_to_be_invoked.LoadAllAssets( );
|
|
translator.Push(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
if(gen_param_count == 2&& translator.Assignable<System.Type>(L, 2))
|
|
{
|
|
System.Type _type = (System.Type)translator.GetObject(L, 2, typeof(System.Type));
|
|
|
|
var gen_ret = gen_to_be_invoked.LoadAllAssets( _type );
|
|
translator.Push(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.AssetBundle.LoadAllAssets!");
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_LoadAllAssetsAsync(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
UnityEngine.AssetBundle gen_to_be_invoked = (UnityEngine.AssetBundle)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
|
|
if(gen_param_count == 1)
|
|
{
|
|
|
|
var gen_ret = gen_to_be_invoked.LoadAllAssetsAsync( );
|
|
translator.Push(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
if(gen_param_count == 2&& translator.Assignable<System.Type>(L, 2))
|
|
{
|
|
System.Type _type = (System.Type)translator.GetObject(L, 2, typeof(System.Type));
|
|
|
|
var gen_ret = gen_to_be_invoked.LoadAllAssetsAsync( _type );
|
|
translator.Push(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.AssetBundle.LoadAllAssetsAsync!");
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_Unload(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
UnityEngine.AssetBundle gen_to_be_invoked = (UnityEngine.AssetBundle)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
bool _unloadAllLoadedObjects = LuaAPI.lua_toboolean(L, 2);
|
|
|
|
gen_to_be_invoked.Unload( _unloadAllLoadedObjects );
|
|
|
|
|
|
|
|
return 0;
|
|
}
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _m_UnloadAsync(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
UnityEngine.AssetBundle gen_to_be_invoked = (UnityEngine.AssetBundle)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
bool _unloadAllLoadedObjects = LuaAPI.lua_toboolean(L, 2);
|
|
|
|
var gen_ret = gen_to_be_invoked.UnloadAsync( _unloadAllLoadedObjects );
|
|
translator.Push(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_GetAllAssetNames(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
UnityEngine.AssetBundle gen_to_be_invoked = (UnityEngine.AssetBundle)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
var gen_ret = gen_to_be_invoked.GetAllAssetNames( );
|
|
translator.Push(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_GetAllScenePaths(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
UnityEngine.AssetBundle gen_to_be_invoked = (UnityEngine.AssetBundle)translator.FastGetCSObj(L, 1);
|
|
|
|
|
|
|
|
{
|
|
|
|
var gen_ret = gen_to_be_invoked.GetAllScenePaths( );
|
|
translator.Push(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_RecompressAssetBundleAsync_xlua_st_(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
|
|
|
|
int gen_param_count = LuaAPI.lua_gettop(L);
|
|
|
|
if(gen_param_count == 5&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& translator.Assignable<UnityEngine.BuildCompression>(L, 3)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4)&& translator.Assignable<UnityEngine.ThreadPriority>(L, 5))
|
|
{
|
|
string _inputPath = LuaAPI.lua_tostring(L, 1);
|
|
string _outputPath = LuaAPI.lua_tostring(L, 2);
|
|
UnityEngine.BuildCompression _method;translator.Get(L, 3, out _method);
|
|
uint _expectedCRC = LuaAPI.xlua_touint(L, 4);
|
|
UnityEngine.ThreadPriority _priority;translator.Get(L, 5, out _priority);
|
|
|
|
var gen_ret = UnityEngine.AssetBundle.RecompressAssetBundleAsync( _inputPath, _outputPath, _method, _expectedCRC, _priority );
|
|
translator.Push(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
if(gen_param_count == 4&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& translator.Assignable<UnityEngine.BuildCompression>(L, 3)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 4))
|
|
{
|
|
string _inputPath = LuaAPI.lua_tostring(L, 1);
|
|
string _outputPath = LuaAPI.lua_tostring(L, 2);
|
|
UnityEngine.BuildCompression _method;translator.Get(L, 3, out _method);
|
|
uint _expectedCRC = LuaAPI.xlua_touint(L, 4);
|
|
|
|
var gen_ret = UnityEngine.AssetBundle.RecompressAssetBundleAsync( _inputPath, _outputPath, _method, _expectedCRC );
|
|
translator.Push(L, gen_ret);
|
|
|
|
|
|
|
|
return 1;
|
|
}
|
|
if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING)&& translator.Assignable<UnityEngine.BuildCompression>(L, 3))
|
|
{
|
|
string _inputPath = LuaAPI.lua_tostring(L, 1);
|
|
string _outputPath = LuaAPI.lua_tostring(L, 2);
|
|
UnityEngine.BuildCompression _method;translator.Get(L, 3, out _method);
|
|
|
|
var gen_ret = UnityEngine.AssetBundle.RecompressAssetBundleAsync( _inputPath, _outputPath, _method );
|
|
translator.Push(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.AssetBundle.RecompressAssetBundleAsync!");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_isStreamedSceneAssetBundle(RealStatePtr L)
|
|
{
|
|
try {
|
|
ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
|
|
|
|
UnityEngine.AssetBundle gen_to_be_invoked = (UnityEngine.AssetBundle)translator.FastGetCSObj(L, 1);
|
|
LuaAPI.lua_pushboolean(L, gen_to_be_invoked.isStreamedSceneAssetBundle);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _g_get_memoryBudgetKB(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
LuaAPI.xlua_pushuint(L, UnityEngine.AssetBundle.memoryBudgetKB);
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
|
|
|
|
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
|
|
static int _s_set_memoryBudgetKB(RealStatePtr L)
|
|
{
|
|
try {
|
|
|
|
UnityEngine.AssetBundle.memoryBudgetKB = LuaAPI.xlua_touint(L, 1);
|
|
|
|
} catch(System.Exception gen_e) {
|
|
return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|