Lua向C#逻辑迁移 一期 #13

将整个插件代码上传
This commit is contained in:
2025-10-26 21:48:39 +08:00
parent 56994b3927
commit 648386cd73
785 changed files with 53683 additions and 2 deletions

View File

@ -0,0 +1,27 @@
#include "CSGlueGenerator.h"
#include "UnrealSharpRuntimeGlue.h"
#include "Logging/StructuredLog.h"
#include "UnrealSharpProcHelper/CSProcHelper.h"
void UCSGlueGenerator::SaveRuntimeGlue(const FCSScriptBuilder& ScriptBuilder, const FString& FileName, const FString& Suffix)
{
const FString Path = FPaths::Combine(FCSProcHelper::GetProjectGlueFolderPath(), FileName + Suffix);
FString CurrentRuntimeGlue;
FFileHelper::LoadFileToString(CurrentRuntimeGlue, *Path);
if (CurrentRuntimeGlue == ScriptBuilder.ToString())
{
// No changes, return
return;
}
if (!FFileHelper::SaveStringToFile(ScriptBuilder.ToString(), *Path))
{
UE_LOGFMT(LogUnrealSharpRuntimeGlue, Error, "Failed to save runtime glue to {0}", *Path);
return;
}
UE_LOGFMT(LogUnrealSharpRuntimeGlue, Display, "Saved {0}", *FileName);
FUnrealSharpRuntimeGlueModule::Get().GetOnRuntimeGlueChanged().Broadcast(this, Path);
}