Skip to content

Instantly share code, notes, and snippets.

@Delaunay
Created November 13, 2022 02:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Delaunay/74eb360a9e3dde612ae83d19de017125 to your computer and use it in GitHub Desktop.
Save Delaunay/74eb360a9e3dde612ae83d19de017125 to your computer and use it in GitHub Desktop.
GKGameplayCueNotify_ActorExample
// 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() {
}
// 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