public UObject LoadSynchronous() { using (FSoftObjectPtrUnsafe objectPtr = new FSoftObjectPtrUnsafe(softObjectPath)) { return(objectPtr.LoadSynchronous()); } }
public FSoftObjectPtr GetValuePtr(IntPtr address) { // Don't dispose of objectPtr as it will still be held in native memory FSoftObjectPtrUnsafe objectPtr = Marshal.PtrToStructure <FSoftObjectPtrUnsafe>(address); softObject = new FSoftObjectPtr(objectPtr.ObjectPath); return(softObject); }
public void SetValuePtr(IntPtr address, FSoftObjectPtr value) { softObject = value; using (FSoftObjectPtrUnsafe tempObjectPtr = new FSoftObjectPtrUnsafe(softObject.ObjectPath)) { // Use Copy to ensure a deep copy FSoftObjectPtrUnsafe existing = Marshal.PtrToStructure <FSoftObjectPtrUnsafe>(address); existing.Copy(tempObjectPtr); // Copy the structure back to into the address Marshal.StructureToPtr(existing, address, false); } }