Hello, so this isn’t critical at all, but I was just wondering if any of you knew the answer to this:
Suppose I have this code (and UThing is just any asset type):
UThing* UMyActor::GetMyThing() {
UThing* LoadedThing = LoadObject<UThing>(nullptr, TEXT("/Game/Things/MyThing.MyThing), nullptr, LOAD_None, nullptr);
return LoadedThing;
}
void UMyActor::SomeFunction() {
UThing* MyThing;
MyThing = GetMyThing();
// Do some stuff...
MyThing = nullptr;
// Do more stuff....
MyThing = GetMyThing();
// Do even more stuff...
}
My question is, when SomeFunction
is execyted, does MyThing.MyThing
get loaded once or twice?
And, if it does get loaded twice, would it only get loaded once if prepended UThing* LoadedThing
with static
?