/// <summary> /// 根据脚本ID创建运行时脚本 /// </summary> /// <param name="id"></param> /// <returns></returns> public static ScriptFile LoadSync(string id) { return(ScriptHeader.LoadSync(id).Header.CreateRuntimeFile()); }
/// <summary> /// 根据脚本ID创建运行时脚本 /// </summary> /// <param name="id"></param> /// <returns></returns> public static async Task <ScriptFile> Load(string id) { return((await ScriptHeader.Load(id)).Header.CreateRuntimeFile()); }
/// <summary> /// 创建一个运行时脚本 /// </summary> /// <param name="header">脚本执行内容文件头</param> /// <param name="code">脚本代码段</param> public ScriptFile([NotNull] ScriptHeader header, [NotNull] byte[] code) { Header = header; _reader = new ExtendedBinaryReader(new MemoryStream(code)); ActiveTranslation = Header.LoadDefaultTranslation(); }