Files
BusyRabbit/Plugins/UnrealSharp/Source/UnrealSharpManagedGlue/PropertyTranslators/WorldContextObjectPropertyTranslator.cs
wyatt 648386cd73 Lua向C#逻辑迁移 一期 #13
将整个插件代码上传
2025-10-26 21:48:39 +08:00

22 lines
877 B
C#

using EpicGames.UHT.Types;
using UnrealSharpScriptGenerator.Utilities;
namespace UnrealSharpScriptGenerator.PropertyTranslators;
public class WorldContextObjectPropertyTranslator : ObjectPropertyTranslator
{
public override bool ShouldBeDeclaredAsParameter => false;
public override bool CanExport(UhtProperty property)
{
return base.CanExport(property) && property.IsWorldContextParameter();
}
public override void ExportToNative(GeneratorStringBuilder builder, UhtProperty property, string propertyName, string destinationBuffer,
string offset, string source)
{
builder.AppendLine($"BlittableMarshaller<IntPtr>.ToNative(IntPtr.Add({destinationBuffer}, {offset}), 0, UnrealSharp.Core.FCSManagerExporter.CallGetCurrentWorldContext());");
}
public override bool CanSupportGenericType(UhtProperty property) => false;
}