feat: move Lua scripts to Script/lua and add binary UE bundle packing
This commit is contained in:
1 parent
256a60ac80
commit
ebce41f347
41 files changed
+1545
-57
No files matched your search
@@ -19,6 +19,11 @@
|
||||
|
||||
FString UUnLuaFunctionLibrary::GetScriptRootPath()
|
||||
{
|
||||
const FString ExternalScriptDir = FPaths::ConvertRelativePathToFull(FPaths::Combine(FPaths::ProjectDir(), TEXT("Script/lua/")));
|
||||
if (FPaths::DirectoryExists(ExternalScriptDir))
|
||||
{
|
||||
return ExternalScriptDir;
|
||||
}
|
||||
return FPaths::ConvertRelativePathToFull(FPaths::ProjectContentDir() + TEXT("Script/"));
|
||||
}
|
||||
|
||||
|
||||
@@ -69,5 +69,5 @@ namespace UnLua
|
||||
|
||||
} // namespace UnLua
|
||||
|
||||
FString GLuaSrcRelativePath = TEXT("Script/");
|
||||
FString GLuaSrcFullPath = FPaths::ConvertRelativePathToFull(FPaths::ProjectContentDir() + GLuaSrcRelativePath);
|
||||
FString GLuaSrcRelativePath = TEXT("../Script/lua/");
|
||||
FString GLuaSrcFullPath = FPaths::ConvertRelativePathToFull(FPaths::Combine(FPaths::ProjectDir(), TEXT("Script/lua/")));
|
||||
@@ -185,6 +185,14 @@ private:
|
||||
|
||||
void SetupPackagingSettings()
|
||||
{
|
||||
// When external <ProjectDir>/Script/lua is used, Lua scripts are packed into a binary UE asset
|
||||
// instead of staging loose Content/Script directories.
|
||||
const FString ExternalScriptDir = FPaths::Combine(FPaths::ProjectDir(), TEXT("Script/lua"));
|
||||
if (FPaths::DirectoryExists(ExternalScriptDir))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
auto ScriptPaths = TArray<FString>{TEXT("Script"), TEXT("../Plugins/UnLua/Content/Script")};
|
||||
|
||||
const auto Plugins = IPluginManager::Get().GetEnabledPlugins();
|
||||
|
||||
Reference in new issue
Block a user