using UnityEngine;
using XLua;
using System.IO;
public class TestTool : MonoBehaviour
{
private const string path = "ZTest2/_lua/testLuaStr.lua";
void Start()
{
LuaEnv luaEnv = new LuaEnv();
luaEnv.AddLoader(OnCustomLoader);
luaEnv.DoString($@"testLuaStr = require '{path}'");
luaEnv.Dispose();
luaEnv = null;
}
private static byte[] OnCustomLoader(ref string filepath)
{
string path = Path.Combine(Application.dataPath, filepath);
return File.ReadAllBytes(path);
}
}
local this = {}
LuaBridge = CS.Framework.Lua.LuaBridge
local function test1()
local strs = {};
for i = 1, 50000, 1 do
strs[i] = "helloworld";
end
local result = "";
local startTime = os.clock();
for index, str in ip