forked from Tencent/puerts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'Tencent:master' into master
- Loading branch information
Showing
48 changed files
with
329 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,52 @@ | ||
### 源码安装方式 | ||
## Source Code Installation Method | ||
|
||
* git clone https://github.com/Tencent/puerts.git | ||
1. Clone the repository: | ||
```sh | ||
git clone https://github.com/Tencent/puerts.git | ||
``` | ||
|
||
* 拷贝puerts/unreal下的Puerts目录到您项目的Plugins目录下,可以参考[unreal demo](https://github.com/chexiongsheng/puerts_unreal_demo) | ||
2. Copy the `Puerts` directory from `puerts/unreal` to your project's `Plugins` directory. You can refer to the Unreal demo for guidance. | ||
* 下载v8 | ||
3. Download V8: | ||
- For UE4.25 and above, choose one: [8.4.371.19](https://github.com/puerts/backend-v8/releases/download/V8_8.4.371.19_230822/v8_bin_8.4.371.19.tgz), [9.4.146.24](https://github.com/puerts/backend-v8/releases/download/V8_9.4.146.24_240430/v8_bin_9.4.146.24.tgz), [10.6.194](https://github.com/puerts/backend-v8/releases/download/V8_10.6.194_240612/v8_bin_10.6.194.tgz) | ||
- For UE4.24 and below: [V8 for ue 4.24 or below](https://github.com/puerts/backend-v8/releases/download/v8_for_ue424_or_below/v8_for_ue424_or_below.tgz) | ||
- UE4.25及以上版本:[V8 backends](https://github.com/puerts/backend-v8/releases) | ||
|
||
- UE4.24及以下版本:[V8 for ue 4.24 or below](https://github.com/puerts/backend-v8/releases/tag/v8_for_ue424_or_below) | ||
|
||
* 解压到`YouProject/Plugins/Puerts/ThirdParty`,如果下载的是9.4版本请手动重命名v8_9.4目录为v8 | ||
4. Extract the downloaded V8 to `YourProject/Plugins/Puerts/ThirdParty`, And Change the UseV8Version setting in JsEnv.build.cs according to version you downloaded. | ||
### 发布包安装方式 | ||
## Release Package Installation Method | ||
到[releases](https://github.com/Tencent/puerts/releases)找到你需要的版本,注意,该页面也包含Unity的发布包,Unreal引擎使用版本会以Unreal开头。 | ||
1. Go to the [releases page](https://github.com/Tencent/puerts/releases) and find the version you need. Note that this page also includes release packages for Unity; Unreal Engine versions will start with "Unreal". | ||
下载符合你UE版本的安装包,解压到YouProject/Plugins即可,已经内含v8库。 | ||
2. Download the package that matches your UE version and extract it to `YourProject/Plugins`. The V8 library is already included. | ||
### 注意事项 | ||
## Notes | ||
* mac下如果遇到移入废纸篓问题,请执行 | ||
1. **Mac Users:** | ||
If you encounter the "Move to Trash" issue, execute the following commands: | ||
```sh | ||
cd Plugins/Puerts/ThirdParty | ||
find . -name "*.dylib" | xargs sudo xattr -r -d com.apple.quarantine | ||
``` | ||
~~~bash | ||
cd Plugins/Puerts/ThirdParty | ||
find . -name "*.dylib" | xargs sudo xattr -r -d com.apple.quarantine | ||
~~~ | ||
2. **Blueprint-Only Projects:** | ||
If you see the error "Plugin 'Puerts' failed to load because module 'JsEnv' could not be found,” it’s because pure Blueprint projects do not automatically compile Plugins. Since Puerts includes C++ source code, you need to convert your Blueprint project to a C++ project by adding a C++ class. Alternatively, you can compile the UE engine with Puerts included during the compilation. | ||
* 纯蓝图工程提示“Plugin 'Puerts' failed to load because module 'JsEnv' could not be found.” | ||
## Virtual Machine Switching | ||
纯蓝图工程不会自动编译Plugins,而Puerts目前的源码或者发布包内,都是C++源码。 | ||
Puerts supports multiple script backends: V8, quickjs, nodejs. | ||
一个纯蓝图如何使用一个C++ Plugins是个UE通用问题,目前已知可行的方式是添加一个C++代码把这纯蓝图工程转为C++工程,另外一个比较有可能(但未验证的方式)是自行编译UE引擎,而且编译引擎时把puerts放进去一起编译。 | ||
- **V8**: Provides a clean ECMAScript implementation. | ||
- **Quickjs**: Suitable for scenarios with strict package size requirements. | ||
- **Nodejs**: Supports more npm modules than the V8 version but results in a larger package size. | ||
### 虚拟机切换 | ||
### Download Quickjs Backend | ||
[Quickjs Download](https://github.com/Tencent/puerts/releases) | ||
puerts支持多种脚本后端:V8,quickjs,nodejs | ||
### Download Nodejs Backend | ||
[Nodejs Download](https://github.com/Tencent/puerts/releases) | ||
* v8提供了纯净的ECMAScript实现 | ||
* 对于包大小苛刻的场景,可以选用quickjs | ||
* nodejs相比v8版本,可以使用更多的npm模块,但包体比v8还要大些 | ||
Extract the downloaded backend to `YourProject/Plugins/Puerts/ThirdParty`. | ||
quickjs后端[下载](https://github.com/puerts/backend-quickjs/releases) | ||
|
||
nodejs后端[下载](https://github.com/puerts/backend-nodejs/releases) | ||
|
||
解压到`YouProject/Plugins/Puerts/ThirdParty` | ||
|
||
修改[JsEnv.Build.cs](https://github.com/Tencent/puerts/blob/master/unreal/Puerts/Source/JsEnv/JsEnv.Build.cs) ,UseQuickjs为true表示用quickjs后端,UseNodejs表示用nodejs后端。 | ||
Modify `JsEnv.Build.cs`: | ||
- Set `UseQuickjs` to `true` to use the Quickjs backend. | ||
- Set `UseNodejs` to use the Nodejs backend. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.