I was shocked when I saw that the #PlayFab #UnrealEngine plugin uses a TSharedPtr<UPlayFabAuthenticationContext>, where the UPlayFabAuthenticationContext is a UObject.
I always thought this to be impossible.
They use this #Hack to make it work:
- First create a TSharedRef<TStrongObjectPtr<UObject>>.
- Then use the aliasing constructor
TSharedPtr(TSharedPtr<OtherType>, ObjectType*) to create a new shared pointer using the Shared Reference as first, and the UObject as second parameter.
#GameDev
@landelare I have no clue...
My best guess is that they both want to use the same reference-type in C++ and Blueprint (so it needs to be a UObject) and they want you to use their factory instead of just using NewObject()...