• Stars
    star
    172
  • Rank 220,184 (Top 5 %)
  • Language
    C++
  • License
    MIT License
  • Created about 4 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

unreal demo for puerts

unreal demo for puerts

怎么跑这demo?

  • git clone https://github.com/chexiongsheng/puerts_unreal_demo.git

  • ue4.25及以上版本,需要到这里下载V8_8.4.371.19_0323,解压到Plugins/Puerts/ThirdParty

  • 生成vs工程(window下,在mac下生成xcode工程),然后进入工程编译

  • 如果要打包运行,要到“项目设置/打包/Additional Not-Asset Directories to Package”,把Content下的“JavaScript”目录添加进去。

  • 如果打开基础ue类功能,可能会报找不到react-reconciler的错误,需要到Content/JavaScript下执行npm install .安装依赖的库。

Demo说明

  • 本demo目录是一个Typescript工程,可以用vscode(建议安装vscode,nodejs,typescript)打开这个目录。

  • TsGameInstance.cpp是程序逻辑的入口,里头关键语句是JsEnv->Start("QuickStart"),其执行了启动脚本QuickStart.js。

  • QuickStart.js是由TsProj下QuickStart.ts的编译结果,所以直接看QuickStart.ts即可,里头演示主要功能的用法。

  • 编译,在vscode上“Terminal -> Run Build Task”选tsc watch,修改代码后会自动编译。

  • PerfTest.ts编辑器下在老版本v8以及quickjs后端不可用