diff --git a/03-UnrealEngine/Gameplay/PuerTS/Puerts(一)——学习资料归纳.md b/03-UnrealEngine/Gameplay/PuerTS/Puerts(一)——学习资料归纳.md index d59ebbb..51e459a 100644 --- a/03-UnrealEngine/Gameplay/PuerTS/Puerts(一)——学习资料归纳.md +++ b/03-UnrealEngine/Gameplay/PuerTS/Puerts(一)——学习资料归纳.md @@ -41,20 +41,38 @@ npm install -g typescript tsc xxx.ts ``` +# Puerts +## QuickStart +1. 编译插件后进入工程,点击工具栏的`ue.d.ts`生成接口代码。 +2. 代码写在项目目录下的`TypeScript`中。(插件运行后会自动创建) +3. 之后就会在编辑器`Blueprints/TypeScript`目录下出现资产图标。 +### 调试方法 +具体可以参考:# Puerts Inspector指南(一)在UE4和Unity里调试Javascripthttps://zhuanlan.zhihu.com/p/359598262 -## VSCode中的使用方法 +#### 方式1:自创建虚拟机模式下调试配置 +创建FJsEnv传入调试端口 +```c++ +//8080是调试端口 GameScript = MakeShared(std::make_unique(TEXT("JavaScript")), std::make_shared(), 8080); +``` +阻塞等待调试器链接 +```c++ +GameScript = MakeShared(std::make_unique(TEXT("JavaScript")), std::make_shared(), 8080); +GameScript->WaitDebugger(); +GameScript->Start("QuickStart", Arguments); +``` -## Debug +#### 方式2:自动绑定模式下调试配置 +菜单上选择“编辑->项目设置”,打开设置页面后在“插件->Puerts Setting”页面中开启调试以及设置端口 # TypeScript - # Puerts ## 热更新方法 https://zhuanlan.zhihu.com/p/364505146 + ## UE访问Puerts 通过UDynamicDelegateProxy,其成员记录了绑定的虚拟机与JS函数。 \ No newline at end of file