Files
Cog/Source/CogSample/CogSampleGameState.h
T
Arnaud Jamin 6d9494b685 Major Change - Rework how Cog gets integrated
Cog integration has been reworked to make it easier,  to keep Cog available between level loadings, and to properly tick ImGui while the game is paused.
Cog 's WindowManager is now a GameInstanceSubsystem.
The WindowManager ticks ImGui and the windows during the OnWorldPostActorTick delegate.
(If this is not working for your project, don't hesitate to open an issue.)

Check the readme to see how to integrate Cog.

The Plot debug functions (displayed by the Engine/Plot window) have been reworked as they were not properly working in Multi PIE in Single Process.

API changes:
- use FCogDebug::Plot instead of FCogDebugPlot::PlotValue
- use FCogDebug::InstantEvent  instead of FCogDebugPlot::PlotEventInstant
- use FCogDebug::StartEvent instead of FCogDebugPlot::PlotEventStart
- use FCogDebug::StopEvent instead of FCogDebugPlot::PlotEventStop
2025-02-11 13:29:12 -05:00

53 lines
1.5 KiB
C++

#pragma once
#include "CoreMinimal.h"
#include "CogCommon.h"
#include "GameFramework/GameStateBase.h"
#include "CogSampleGameState.generated.h"
class UCogWindowManager;
class UCogSampleAbilitySystemComponent;
UCLASS()
class ACogSampleGameState : public AGameStateBase
{
GENERATED_BODY()
ACogSampleGameState(const FObjectInitializer& ObjectInitializer);
virtual void BeginPlay() override;
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
virtual void Tick(float DeltaSeconds) override;
private:
//---------------------------------------------------------------------------------
// The game state has an AbilitySystemComponent to serve as the default instigator
// for effects that are not applied by characters.
//---------------------------------------------------------------------------------
UPROPERTY()
UCogSampleAbilitySystemComponent* AbilitySystemComponent = nullptr;
//---------------------------------------------------------------------------------
// To make sure it doesn't get garbage collected.
//---------------------------------------------------------------------------------
UPROPERTY()
TObjectPtr<UObject> CogWindowManagerRef = nullptr;
protected:
UPROPERTY(Replicated)
float _ServerFramerateRaw = 0.0f;
#if ENABLE_COG
TObjectPtr<UCogWindowManager> CogWindowManager = nullptr;
float _ClientFramerateSmooth = 0.0f;
float _ServerFramerateSmooth = 0.0f;
#endif //ENABLE_COG
};