/// <summary> /// 02.载入脚本 /// </summary> /// <param name="id">编号</param> public void LoadScript(int id) { if (scriptLoaded) { reader.Close(); } scriptLoaded = true; index = id; var opcodes = (Dictionary <byte, ScriptOpcode>)ScriptUtil.Clone(bytesToOpcodeDict); reader = new ScriptReader(ScriptFilename(index), opcodes, scriptVersion); reader.ReadScript(); // 读入整个脚本 CurrentCodeID = 0; }