Skip to content

Commit 249cac0

Browse files
author
alexqzhou
committed
update
1 parent 44c0b04 commit 249cac0

File tree

1 file changed

+37
-4
lines changed

1 file changed

+37
-4
lines changed

8.misc/ue4_upgrade_guide.md

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# UE4 代码多版本兼容指南
22

3-
在升级一些旧有UE4代码时,通常会遇到方法变更等问题
3+
在升级一些旧有UE4代码时,通常会遇到引擎接口变更等问题,为了减少升级维护成本,可以通过以下方法实现游戏项目无缝升级
44

55
项目Build.cs中使用宏WITH_FORWARDED_MODULE_RULES_CTOR来兼容4.16前后版本
66

@@ -17,7 +17,7 @@
1717

1818
C++ 代码部分
1919

20-
在预编译头文件加入 "Runtime/Launch/Resources/Version.h" 版本信息头文件,使用引擎版本宏区分代码
20+
在预编译头文件加入 "Runtime/Launch/Resources/Version.h" 版本信息头文件,使用引擎版本宏区分代码
2121

2222
``` cpp
2323
#include "Runtime/Launch/Resources/Version.h"
@@ -31,7 +31,7 @@ C++ 代码部分
3131

3232
```
3333

34-
项目文件uproject依赖的编译插件需要显式声明
34+
项目文件uproject依赖的编译插件需要显式声明(LuaPlugin是我们项目使用的Lua桥接代码生成插件):
3535

3636
``` json
3737
,
@@ -43,6 +43,39 @@ C++ 代码部分
4343
]
4444
```
4545

46-
插件以赖的插件也需要显式声明
46+
插件依赖的插件也需要显式声明,如下(Apollo依赖引擎插件OnlineSubsystem)
47+
48+
``` json
49+
"Modules": [
50+
{
51+
"Name": "OnlineSubsystemApollo",
52+
"Type": "Runtime",
53+
"LoadingPhase": "Default",
54+
"WhitelistPlatforms": [ "Win32", "Win64", "Android", "IOS", "Mac", "PS4", "XBOXONE", "HTML5" ],
55+
"BlacklistPlatforms": [ "Linux" ]
56+
}
57+
],
58+
"Plugins": [
59+
{
60+
"Name": "OnlineAdapter",
61+
"Enabled": true
62+
},
63+
{
64+
"Name": "OnlineSubsystemUtils",
65+
"Enabled": true
66+
},
67+
{
68+
"Name": "OnlineSubsystem",
69+
"Enabled": true
70+
}
71+
]
72+
```
73+
4774

4875
4.17 插件Shader声明,材质参数头文件路径变更
76+
77+
``` hlsl
78+
// 4.17以后的版本支持自定义渲染插件,shader的参数头文件路径使用如下头文件
79+
#include "/Engine/Public/Platform.ush"
80+
#include "/Engine/Generated/GeneratedUniformBuffers.ush"
81+
```

0 commit comments

Comments
 (0)