Skip to content

Commit 7a2781e

Browse files
Merge branch 'develop'
2 parents ce0cc4e + 7176781 commit 7a2781e

96 files changed

Lines changed: 1369 additions & 1208 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
**/.DS_Store
12
.vs/
23
Binaries/
34
Build/
@@ -18,3 +19,4 @@ IOS/
1819
/.idea
1920
/TPSProject.sln.DotSettings.user
2021
/Plugins/Developer/RiderLink
22+
/Benchmark

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,34 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [2.3.0] - 2022-10-8
8+
9+
### Added
10+
- 支持使用 `UnLua.PackagePath` 的方式来搜索Lua文件,也支持从插件Content目录加载
11+
- 支持Android下的x86_64
12+
- 支持自定义预绑定类型,参考[预绑定类型列表](./Docs/CN/Settings.md#预绑定类型列表)配置选项
13+
- 支持UE5下的蓝图UMG输入绑定,使用新增的 `UnLua.Input` 模块,可以做到更细节的输入绑定
14+
- `UnLua.Ref``UnLua.Unref` 接口,提供将 `UObject` 生命周期和Lua侧同步的管理机制
15+
- 提升Lua访问UE函数和属性的性能
16+
- [自定义生成Lua模版](./Docs/CN/CustomTemplate.md)
17+
18+
### Fixed
19+
- Mac下编辑器的dylib无法加载
20+
- PushMetatable时会使用旧的metatable [#515](https://github.com/Tencent/UnLua/pull/515)
21+
- Delegate的闭包函数的upvalue无法被gc [#516](https://github.com/Tencent/UnLua/issues/516)
22+
- 在Lua中访问TArray不存在的字段会报stackoverflow
23+
- 自动保存的打包设置没有生效
24+
- UE5下打包后UnLua配置没有正确加载
25+
26+
### Changed
27+
- 默认关闭运行时对`UTF-8 BOM`文件头的加载支持,需要兼容请开启[兼容UTF-8 BOM文件头](./Docs/CN/Settings.md#兼容UTF-8%20BOM文件头)选项
28+
29+
### Removed
30+
- 移除 `AddPackagePath` 接口
31+
732
## [2.2.4] - 2022-9-1
33+
34+
### Added
835
- 增加最佳实践工程示例 [Lyra with UnLua](https://github.com/xuyanghuang-tencent/LyraWithUnLua)
936
- 支持配置按C/C++编译Lua环境
1037
- 支持Lua启动入口脚本配置

Content/Localization/UnLua/UnLua.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ Date/Time,Word Count,zh-Hans
1414
2022.06.07-19.09.46,606,606
1515
2022.06.07-21.37.50,504,504
1616
2022.06.07-22.44.41,568,568
17+
2022.09.24-18.38.33,665,665
14.1 KB
Binary file not shown.
9.88 KB
Binary file not shown.
1.89 KB
Binary file not shown.
Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
local M = UnLua.Class()
2+
3+
local Start = UE.UUnLuaBenchmarkFunctionLibrary.Start
4+
local Stop = UE.UUnLuaBenchmarkFunctionLibrary.Stop
5+
local StartTimer = UE.UUnLuaBenchmarkFunctionLibrary.StartTimer
6+
local StopTimer = UE.UUnLuaBenchmarkFunctionLibrary.StopTimer
7+
8+
function M:Run(N)
9+
local SpawnClass = UE.AUnLuaBenchmarkProxy
10+
local Transform = UE.FTransform()
11+
local AlwaysSpawn = UE.ESpawnActorCollisionHandlingMethod.AlwaysSpawn
12+
local Proxy = self:GetWorld():SpawnActor(SpawnClass, Transform, AlwaysSpawn)
13+
14+
-- warm up
15+
for i=1, N do
16+
Proxy:NOP()
17+
end
18+
19+
StartTimer("read int32")
20+
for i=1, N do
21+
local MeshID = Proxy.MeshID
22+
end
23+
StopTimer()
24+
25+
StartTimer("write int32")
26+
for i=1, N do
27+
Proxy.MeshID = i
28+
end
29+
StopTimer()
30+
31+
StartTimer("read FString")
32+
for i=1, N do
33+
local MeshName = Proxy.MeshName
34+
end
35+
StopTimer()
36+
37+
StartTimer("write FString")
38+
for i=1, N do
39+
Proxy.MeshName = "9527"
40+
end
41+
StopTimer()
42+
43+
StartTimer("read FVector")
44+
for i=1, N do
45+
local COM = Proxy.COM
46+
end
47+
StopTimer()
48+
49+
local COM = UE.FVector(1.0, 1.0, 1.0)
50+
StartTimer("write FVector")
51+
for i=1, N do
52+
Proxy.COM = COM
53+
end
54+
StopTimer()
55+
56+
StartTimer("read TArray<FVector>")
57+
for i=1, N do
58+
local Positions = Proxy.Positions
59+
end
60+
StopTimer()
61+
62+
local PredictedPositions = UE.TArray(UE.FVector)
63+
StartTimer("write TArray<FVector>")
64+
for i=1, N do
65+
Proxy.PredictedPositions = PredictedPositions
66+
end
67+
StopTimer()
68+
69+
StartTimer("void NOP()")
70+
for i=1, N do
71+
Proxy:NOP()
72+
end
73+
StopTimer()
74+
75+
StartTimer("void Simulate(float)")
76+
for i=1, N do
77+
Proxy:Simulate(0.0167)
78+
end
79+
StopTimer()
80+
81+
StartTimer("int32 GetMeshID() const")
82+
for i=1, N do
83+
local MeshID = Proxy:GetMeshID()
84+
end
85+
StopTimer()
86+
87+
StartTimer("const FString& GetMeshName() const")
88+
for i=1, N do
89+
local MeshName = Proxy:GetMeshName()
90+
end
91+
StopTimer()
92+
93+
StartTimer("const FVector& GetCOM()")
94+
for i=1, N do
95+
Proxy:GetCOM(COM)
96+
end
97+
StopTimer()
98+
99+
StartTimer("int32 UpdateMeshID(int32)")
100+
for i=1, N do
101+
local NewMeshID = Proxy:UpdateMeshID(1024)
102+
end
103+
StopTimer()
104+
105+
StartTimer("FString UpdateMeshName(const FString&)")
106+
for i=1, N do
107+
local NewMeshName = Proxy:UpdateMeshName("1024")
108+
end
109+
StopTimer()
110+
111+
local Origin = UE.FVector(1.0, 1.0, 1.0)
112+
local Direction = UE.FVector(1.0, 0.0, 0.0)
113+
StartTimer("bool Raycast(const FVector&, const FVector&) const")
114+
for i=1, N do
115+
local bHit = Proxy:Raycast(Origin, Direction)
116+
end
117+
StopTimer()
118+
119+
local Indices = UE.TArray(0)
120+
StartTimer("void GetIndices(TArray<int32>&) const")
121+
for i=1, N do
122+
Proxy:GetIndices(Indices)
123+
end
124+
StopTimer()
125+
126+
for i=1, 1024 do
127+
Indices:Add(i)
128+
end
129+
StartTimer("void GetIndices(TArray<int32>&) const with 1024 items")
130+
for i=1, N do
131+
Proxy:GetIndices(Indices)
132+
end
133+
StopTimer()
134+
135+
StartTimer("void UpdateIndices(const TArray<int32>&)")
136+
for i=1, N do
137+
Proxy:UpdateIndices(Indices)
138+
end
139+
StopTimer()
140+
141+
local Positions = UE.TArray(UE.FVector)
142+
StartTimer("void GetPositions(TArray<FVector>&) const")
143+
for i=1, N do
144+
Proxy:GetPositions(Positions)
145+
end
146+
StopTimer()
147+
148+
for i=1, 1024 do
149+
Positions:Add(UE.FVector(i, i, i))
150+
end
151+
StartTimer("void GetPositions(TArray<FVector>&) const with 1024 items")
152+
for i=1, N do
153+
Proxy:GetPositions(Positions)
154+
end
155+
StopTimer()
156+
157+
StartTimer("void UpdatePositions(const TArray<FVector>&)")
158+
for i=1, N do
159+
Proxy:UpdatePositions(Positions)
160+
end
161+
StopTimer()
162+
163+
StartTimer("const TArray<FVector>& GetPredictedPositions() const")
164+
for i=1, N do
165+
Proxy:GetPredictedPositions(PredictedPositions)
166+
end
167+
StopTimer()
168+
169+
StartTimer("bool GetMeshInfo(int32&, FString&, FVector&, TArray<int32>&, TArray<FVector>&, TArray<FVector>&) const")
170+
for i=1, N do
171+
local bResult, ID, Name = Proxy:GetMeshInfo(0, "", COM, Indices, Positions, PredictedPositions)
172+
end
173+
StopTimer()
174+
175+
StartTimer("FHitResult()")
176+
local FHitResult = UE.FHitResult
177+
for i=1, N do
178+
local HitResult = FHitResult()
179+
end
180+
StopTimer()
181+
end
182+
183+
return M

0 commit comments

Comments
 (0)