這兩天閑下來的時候就看了下udn上的很多文章,順帶記錄一個小技巧:
將unreal script compiler集成到vs里
用ue的人都應該不太喜歡每次還得開一個額外的命令行來編譯腳本。當然每次運行程序的時候ue也會提示你.u文件過期,是否重編?但實際上有些時候由于.u也是從peforce上得的,所以有可能雖然.u文件不是最新的,但是還是不會提醒你重編。(你也可以在perforce里手動設置不獲取.u文件)所以還是挺麻煩的。
udn上介紹了一個方法將這個過程集成到vs里,方便簡單(實際上,可能vs老手都應該會了。。)
首先設置一個外部命令:
Visual Studio -> Tools -> ExternalCommands
Title: Build Script Debug
Command: <full path>\UnrealEngine3\Binaries\Win32\<your game>.com
Arguments: make -full -debug
Initial Directory: $(TargetDir)..\..\
Use Output Window: checked
(我一般習慣編譯debug版,一方面快,另一方也方便調(diào)試)
然后在vs的macro IDE里添加下面的內(nèi)容(ExternalCommand(n)的數(shù)字為External Tool的位置):
Sub MakeScriptDebug()
DTE.ExecuteCommand("View.Output")
DTE.ExecuteCommand("File.SaveAll")
' Note: assumes script make release is properly set up as ExternalCommand1
DTE.ExecuteCommand("Tools.ExternalCommand1")
End Sub
然后可以在設置里為其添加一個快捷鍵(我設置的是Shift+F7~)。這樣一來就直接內(nèi)嵌咯~