游戏脚本管理
发布时间:2010年06月11日
end;
Application.MessageBox(PAnsiChar(sResult), '运行结果', 0);
end;
procedure TScript.UnLoadScript;
begin
FCommandList.Clear;
end;
end. 这里是测试代码。 procedure TGameMain.Button1Click(Sender: TObject); //请在form中放入一个button 后粘贴代码到单击事件中
var
FScript : TScript;
begin
FScript := TScript.Create;
FScript.LoadScript('E:\projects\GameEngine\Scripts\Test.src'); //修改为你保存脚本的路径
(Sender as TButton).Enabled := FALSE;
FScript.RunScript; //等待按键时只需要单击一下form即可继续运行。
(Sender as TButton).Enabled := TRUE;
FScript.Free;
end; 这里是关于上面代码的图解说明:
PrintString NewLine WaitForKeyPress RunScript() Text Console




