Giter VIP home page Giter VIP logo

puerts_unreal_demo's Introduction

unreal demo for puerts

怎么跑这demo?

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

  • ue4.25及以上版本,需要根据文档下载安装v8

  • 生成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后端不可用

  • 若采用较新版本的vscode进行调试,发现无法命中断点,则尝试将本demo目录根目录下".vscode"目录中的"launch.json"中的"remoteRoot"配置项的"${workspaceRoot}"修改为"${workspaceFolder}",或者直接去除"remoteRoot"配置项。

  • UE版本如果>=5.3,ReactUMG插件不可用,需要修改puerts_unreal_demo.uproject禁用该plugin,否则会报编译错误。puerts_unreal_demo.uproject内的Plugins配置修改如下:

"Plugins": [
		{
			"Name": "Puerts",
			"Enabled": true
		},
		{
			"Name": "ReactUMG",
			"Enabled": false
		}
	]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.