This commit is contained in:
Arnaud Jamin
2025-02-12 15:18:33 -05:00
parent 0b13879282
commit 362d248866
3 changed files with 11 additions and 18 deletions
+9 -4
View File
@@ -6,21 +6,26 @@
#include "CogAll.h"
#include "CogSampleWindow_Team.h"
#include "CogSubsystem.h"
#endif
#endif
//--------------------------------------------------------------------------------------------------------------------------
void UCogSampleGameInstance::Init()
{
Super::Init();
#if ENABLE_COG
// Get the cog subsystem
if (UCogSubsystem* CogSubSystem = GetSubsystem<UCogSubsystem>())
{
// Add all the built-in windows. You copy paste this function code to organize the menu differently.
Cog::AddAllWindows(*CogSubSystem);
// Add a custom window
CogSubSystem->AddWindow<FCogSampleWindow_Team>("Gameplay.Team");
// Activate Cog
CogSubSystem->Activate();
}
#endif
}
}
+1 -5
View File
@@ -1,15 +1,11 @@
#pragma once
#include "CoreMinimal.h"
#include "CogSampleGameInstance.generated.h"
class UCogSubsystem;
class UCogSampleAbilitySystemComponent;
UCLASS()
class UCogSampleGameInstance : public UGameInstance
{
GENERATED_BODY()
virtual void Init() override;
void Init() override;
};
+1 -9
View File
@@ -30,20 +30,12 @@ private:
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<UCogSubsystem> CogWindowManager = nullptr;
float _ClientFramerateSmooth = 0.0f;
float _ServerFramerateSmooth = 0.0f;