2024-04-12 19:05:09 -07:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "GameFramework/GameState.h"
|
2024-04-13 02:32:52 -07:00
|
|
|
|
|
2024-04-12 19:05:09 -07:00
|
|
|
|
#include "GasaCommon.h"
|
|
|
|
|
|
|
|
|
|
#include "GasaGameState.generated.h"
|
|
|
|
|
|
|
|
|
|
UCLASS(Blueprintable)
|
|
|
|
|
class GASA_API AGasaGameState : public AGameState
|
|
|
|
|
{
|
|
|
|
|
GENERATED_BODY()
|
|
|
|
|
public:
|
|
|
|
|
#pragma region Cog
|
|
|
|
|
// To make sure it doesn't get garbage collected.
|
|
|
|
|
UPROPERTY()
|
2024-04-12 19:37:31 -07:00
|
|
|
|
TObjectPtr<UObject> CogWindowManagerRef;
|
2024-04-12 19:05:09 -07:00
|
|
|
|
|
|
|
|
|
#if ENABLE_COG
|
2024-04-12 19:37:31 -07:00
|
|
|
|
TObjectPtr<UCogWindowManager> CogWindowManager;
|
2024-04-12 19:05:09 -07:00
|
|
|
|
#endif // ENABLE_COG
|
|
|
|
|
#pragma endregion Cog
|
|
|
|
|
|
|
|
|
|
AGasaGameState();
|
|
|
|
|
|
|
|
|
|
#pragma region GameState
|
|
|
|
|
void BeginPlay() override;
|
|
|
|
|
|
|
|
|
|
void Tick(float DeltaSeconds) override;
|
|
|
|
|
#pragma endregion GameState
|
2024-04-12 23:31:49 -07:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
namespace Gasa
|
|
|
|
|
{
|
2024-04-13 02:32:52 -07:00
|
|
|
|
inline
|
|
|
|
|
AGasaGameState* GetGameState(UObject* Context)
|
|
|
|
|
{
|
|
|
|
|
UWorld* World = GEngine->GetWorldFromContextObject(Context, EGetWorldErrorMode::LogAndReturnNull);
|
|
|
|
|
if (World == nullptr)
|
|
|
|
|
{
|
|
|
|
|
Log("World is null... are you running in a proper context?", ELogV::Error);
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
return Cast<AGasaGameState>(World->GetGameState());
|
2024-04-12 23:31:49 -07:00
|
|
|
|
}
|
|
|
|
|
}
|