public static byte[] Load(ref string path, ref string name, bool binary) { byte[] fileBytes; name = name.Replace('.', '/'); if (binary) { string fullPath = Path.Combine(path, name + ".bytes"); TextAsset asset = AssetsManager.LoadAsset <TextAsset>("lua", fullPath); if (asset == null) { throw new FileNotFoundException($"Lua file:{fullPath} not exist."); } byte[] bytes = AesUtil.AesDecrypt(asset.bytes, AES_KEY, AES_IV); fileBytes = bytes; } else { string fullPath = Path.Combine(path, name + ".lua"); fileBytes = Encoding.UTF8.GetBytes(File.ReadAllText(fullPath)); } return(fileBytes); }