Beispiel #1
0
 public UObject LoadSynchronous()
 {
     using (FSoftObjectPtrUnsafe objectPtr = new FSoftObjectPtrUnsafe(softObjectPath))
     {
         return(objectPtr.LoadSynchronous());
     }
 }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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);
            }
        }