MCPcopy Create free account
hub / github.com/crazytuzi/UnrealCSharp / ArrayGet

Method ArrayGet

Script/Interop/Bridge/ArrayBridge.cs:28–46  ·  view source on GitHub ↗
(nint InHandle, int InIndex)

Source from the content-addressed store, hash-verified

26 }
27
28 [UnmanagedCallersOnly]
29 public static nint ArrayGet(nint InHandle, int InIndex)
30 {
31 var Handle = HandleData.GetHandle(InHandle);
32
33 if (Handle is { IsAllocated: true, Target: Array Array })
34 {
35 if (InIndex < Array.Length)
36 {
37 var Type = Array.GetType().GetElementType()!;
38
39 var Size = Type.IsValueType ? Marshal.SizeOf(Type) : sizeof(nint);
40
41 return Handle.AddrOfPinnedObject() + InIndex * Size;
42 }
43 }
44
45 return 0;
46 }
47
48 [UnmanagedCallersOnly]
49 public static nint ArrayGetRef(nint InHandle, int InIndex)

Callers

nothing calls this directly

Calls 2

GetHandleMethod · 0.80
GetTypeMethod · 0.45

Tested by

no test coverage detected