Created
November 13, 2022 02:25
-
-
Save Delaunay/74eb360a9e3dde612ae83d19de017125 to your computer and use it in GitHub Desktop.
GKGameplayCueNotify_ActorExample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// BSD 3-Clause License Copyright (c) 2022, Pierre Delaunay All rights reserved. | |
#include "GKGameplayCueNotify_ActorExample.h" | |
void AGKGameplayCueNotify_ActorExample::ReuseAfterRecycle() { | |
AGameplayCueNotify_Actor::ReuseAfterRecycle(); | |
OnReuseAfterRecycle(); | |
} | |
bool AGKGameplayCueNotify_ActorExample::Recycle() { | |
bool recycled = AGameplayCueNotify_Actor::Recycle(); | |
if (recycled) { | |
OnRecycle(); | |
} | |
return recycled; | |
} | |
void AGKGameplayCueNotify_ActorExample::OnReuseAfterRecycle_Implementation() { | |
} | |
void AGKGameplayCueNotify_ActorExample::OnRecycle_Implementation() { | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// BSD 3-Clause License Copyright (c) 2022, Pierre Delaunay All rights reserved. | |
#pragma once | |
#include "CoreMinimal.h" | |
#include "GameplayCueNotify_Actor.h" | |
#include "GKGameplayCueNotify_ActorExample.generated.h" | |
/** | |
* Expose OnRecycle | |
*/ | |
UCLASS() | |
class GKGAMEPLAYCUENOTIFY_API AGKGameplayCueNotify_ActorExample : public AGameplayCueNotify_Actor | |
{ | |
GENERATED_BODY() | |
public: | |
/** Called when returning to the recycled pool. Reset all state so that it can be reused. Return false if this class cannot be recycled. */ | |
bool Recycle() override; | |
/** Called when we are about to reuse the GC. Should undo anything done in Recycle like hiding the actor */ | |
void ReuseAfterRecycle() override; | |
/** Called when we are about to reuse the GC. Should undo anything done in Recycle like hiding the actor */ | |
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = Ability) | |
void OnReuseAfterRecycle(); | |
/** Called when returning to the recycled pool. Reset all state so that it can be reused. Return false if this class cannot be recycled. */ | |
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = Ability) | |
void OnRecycle(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment