FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
UnLua/Content/Script/Tutorials/12_CustomLoader.lua at master · dsz0/UnLua · GitHub
This repository was archived by the owner on Aug 8, 2026. It is now read-only.
dsz0
/
UnLua
Public archive
forked from
Tencent/UnLua
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
UnLua
/
Content
/
Script
/
Tutorials
/
12_CustomLoader.lua
Copy path
More file actions
More file actions
Latest commit
History
History
History
41 lines (28 loc) · 1013 Bytes
Breadcrumbs
UnLua
/
Content
/
Script
/
Tutorials
/
12_CustomLoader.lua
Copy path
File metadata and controls
41 lines (28 loc) · 1013 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--[[
说明:通过绑定 FUnLuaDelegates::CustomLoadLuaFile 可以实现自定义Lua加载器
演示两种常见的实现供参考:
方式1:查找路径固定,性能更好
方式2:通过package.path查找,更加灵活
本示例C++源码:
Source\TPSProject\TutorialBlueprintFunctionLibrary.cpp
]]
require
"
UnLua
"
local
Screen
=
require
"
Tutorials.Screen
"
local
M
=
Class
()
local
function
print_intro
()
local
msg
=
[[
—— 本示例来自 "Content/Script/Tutorials.12_CustomLoader.lua"
]]
Screen
.
Print
(
msg
)
end
function
M
:
ReceiveBeginPlay
()
print_intro
()
UE
.
UTutorialBlueprintFunctionLibrary
.
SetupCustomLoader
(
1
)
Screen
.
Print
(
string.format
(
"
FromCustomLoader1:%s
"
,
require
(
"
Tutorials
"
)))
package.loaded
[
"
Tutorials
"
]
=
nil
package.path
=
package.path
..
"
;./?/Index.lua
"
UE
.
UTutorialBlueprintFunctionLibrary
.
SetupCustomLoader
(
2
)
Screen
.
Print
(
string.format
(
"
FromCustomLoader2:%s
"
,
require
(
"
Tutorials
"
)))
end
return
M
Back
|
FazBrowse Home
|
New Git URL