//Res目录已经自动实现了.与/的转换。自定义目录的时候,如果不实现转换
//我们需要在require里面吧所有的[.]修改为/
//后缀实事求是,如果是.lua.txt的话,就需要在Loader里面寻找.lua.txt
private byte[] LoaderForCustomAssets(ref string _filePath){
string _scriptPath=string.Empty;
_filePath=_filePath.Replace(".","/")+".lua";
if (Application.platform==RuntimePlatform.WindowsEditor)
{
_scriptPath=Path.Combine(Application.dataPath,"GameLua");
_scriptPath=Path.Combine(_scriptPath,_filePath);
string resullt=File.ReadAllText(_scriptPath);
return System.Text.Encoding.UTF8.GetBytes(resullt);
}
return null;
}