October 2016
Intermediate to advanced
452 pages
9h 47m
English
Sometimes, it is necessary to remove a delegate binding. This is like setting a function pointer to nullptr so that it no longer references an object that has been deleted.
You'll need to follow the previous recipe in order for you to have a delegate to unregister.
DelegateListener, add the following overridden function declaration:UFUNCTION() virtual void EndPlay(constEEndPlayReason::Type EndPlayReason) override;
void ADelegateListener::EndPlay(constEEndPlayReason::Type EndPlayReason) { Super::EndPlay(EndPlayReason); UWorld* TheWorld = GetWorld(); if (TheWorld != nullptr) { AGameMode* GameMode = UGameplayStatics::GetGameMode(TheWorld); AUE4CookbookGameMode * ...Read now
Unlock full access