I’m trying to understand what we did with UGameplayStatics::GetAllActorsOfClass
.
For example here’s what the documentation says:
static void GetAllActorsOfClass
(
const UObject * WorldContextObject,
TSubclassOf< AActor > ActorClass,
TArray< AActor * > & OutActors
)
The part in question is the second input TSubclassOf< AActor > ActorClass
. Stephen mentions that we learned that when a function requires a TSubclassOf
, we can pass it a UClass
instead. I must have missed learning that, so my question is why can we pass a UClass
instead of a TSubclassOf
? What is the difference between the two?
I guess I assumed that under the hood the TSubclassOf ultimately ends up being a UClass
, and if that’s the case, why wouldn’t the GetAllActorsOfClass
documentation just say it’s needs a UClass
instead of a TSubclassOf
?
Thanks!