custom require path - sonygod/luaxe-nlua GitHub Wiki
c# code
env = new Lua();
env.LoadCLRPackage();
env["this"] = this; // Give the script access to the gameobject.
env["transform"] = transform;
var path = Application.streamingAssetsPath + "/lua/?.lua";
var ss = string.Format("package.path =';{0}'", path);
//Debug.Log(ss);
env.DoString(ss);
env = new Lua();
env.LoadCLRPackage();
//设置lua脚本文件查找路径
env["package.path"] = env["package.path"] + ";" + Application.persistentDataPath + "/lua/?.lua;";