puert 插件继承 以及注意事项
2023-06-30 本文已影响0人
吉凶以情迁
非继承类 需要手动编译,可以通过vscode执行,而继承类自动编译,
tsc -p XXXs\tsconfig.json --watch
vscode task开启自动编译
{
"version": "2.0.0",
"tasks": [
{
"type": "typescript",
"tsconfig": "tsconfig.json",
"option": "watch",
"problemMatcher": [
"$tsc-watch"
],
"group": "build",
"label": "tsc: 监视 - tsconfig.json"
}
]
}
image.png
写了个自动部署向导把代码放到 plugins\Puerts里
@echo off
REM Ensure that enable.bat file is pulled to Plugins/Puerts directory
echo Ensure that enable.bat file is pulled to Plugins/Puerts directory
REM Execute enable_puerts_module.js to enable Puerts module
::node enable_puerts_module.js
REM Change directory to the root directory of the project
cd ../../
::tsc --init
::tsc -w
REM Initialize the root directory
echo Initializing root directory...
for %%I in ("%cd%") do set DIRNAME=%%~nxI
echo Current project name: %DIRNAME%
REM Initialize and install dependencies using npm init and npm install
call npm init
call npm install
REM Output dependency information and prompt user to manually edit package.json file
echo -------------------
echo "dependencies": {
echo "@types/react": "^15.6.6",
echo "@types/react-reconciler": "^0.18.0",
echo "@types/mocha": "^7.0.1"
echo }
echo Copy the above content and edit Rootdir/package.json, then close notepad
notepad package.json
REM Change directory to Content directory and perform initialization and installation of dependencies
cd Content
echo Initializing Content directory...
call npm init
call npm install
REM Output dependency information and prompt user to manually edit package.json file
echo ----------------------------------
echo "dependencies": {
echo "@types/react": "^15.6.6",
echo "@types/react-reconciler": "^0.18.0"
echo }
echo Copy the above content and edit package.json, then close notepad again
notepad package.json
REM Change directory to Source/Current_Project_Name directory, output prompt message, and prompt user to manually edit Build.cs file
cd ../Source/%DIRNAME%
echo --Editing %cd%/%DIRNAME%.Build.cs--------
echo Copy the content and paste it in Build.cs:
echo PrivateDependencyModuleNames.AddRange(new string[]
echo {
echo "JsEnv", "Puerts"
echo });
notepad %DIRNAME%.Build.cs
echo -------END---------------------
REM Keep the command prompt open for user to perform further actions
@echo on
cmd
调试则通过启动虚拟机运行,虚拟机需要 设置游戏实例cpp类