Add method to create and get AIAttackTokenManger

This commit is contained in:
Louis Hobbs 2023-08-17 21:47:53 +01:00
parent 57abe9a3a2
commit ac45acb232
2 changed files with 15 additions and 0 deletions

View File

@ -3,3 +3,7 @@
#include "NakatomiGameInstance.h"
UNakatomiAIAttackTokenManager* UNakatomiGameInstance::GetAIAttackTokenManager()
{
return IsValid(AIAttackTokenManager) ? AIAttackTokenManager : (AIAttackTokenManager = NewObject<UNakatomiAIAttackTokenManager>(this, TEXT("AI Attack Token Manager")));
}

View File

@ -4,6 +4,7 @@
#include "CoreMinimal.h"
#include "Engine/GameInstance.h"
#include "NakatomiAIAttackTokenManager.h"
#include "NakatomiGameInstance.generated.h"
/**
@ -14,4 +15,14 @@ class NAKATOMI_API UNakatomiGameInstance : public UGameInstance
{
GENERATED_BODY()
private:
UPROPERTY()
UNakatomiAIAttackTokenManager* AIAttackTokenManager;
public:
UFUNCTION(BlueprintCallable)
UNakatomiAIAttackTokenManager* GetAIAttackTokenManager();
};