mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-06 15:48:48 +00:00
Cleanup
This commit is contained in:
@@ -6,21 +6,26 @@
|
|||||||
#include "CogAll.h"
|
#include "CogAll.h"
|
||||||
#include "CogSampleWindow_Team.h"
|
#include "CogSampleWindow_Team.h"
|
||||||
#include "CogSubsystem.h"
|
#include "CogSubsystem.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------------------------------
|
|
||||||
void UCogSampleGameInstance::Init()
|
void UCogSampleGameInstance::Init()
|
||||||
{
|
{
|
||||||
Super::Init();
|
Super::Init();
|
||||||
|
|
||||||
#if ENABLE_COG
|
#if ENABLE_COG
|
||||||
|
|
||||||
|
// Get the cog subsystem
|
||||||
if (UCogSubsystem* CogSubSystem = GetSubsystem<UCogSubsystem>())
|
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);
|
Cog::AddAllWindows(*CogSubSystem);
|
||||||
|
|
||||||
|
// Add a custom window
|
||||||
CogSubSystem->AddWindow<FCogSampleWindow_Team>("Gameplay.Team");
|
CogSubSystem->AddWindow<FCogSampleWindow_Team>("Gameplay.Team");
|
||||||
|
|
||||||
|
// Activate Cog
|
||||||
CogSubSystem->Activate();
|
CogSubSystem->Activate();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,15 +1,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "CoreMinimal.h"
|
|
||||||
#include "CogSampleGameInstance.generated.h"
|
#include "CogSampleGameInstance.generated.h"
|
||||||
|
|
||||||
class UCogSubsystem;
|
|
||||||
class UCogSampleAbilitySystemComponent;
|
|
||||||
|
|
||||||
UCLASS()
|
UCLASS()
|
||||||
class UCogSampleGameInstance : public UGameInstance
|
class UCogSampleGameInstance : public UGameInstance
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
virtual void Init() override;
|
void Init() override;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -30,20 +30,12 @@ private:
|
|||||||
UPROPERTY()
|
UPROPERTY()
|
||||||
UCogSampleAbilitySystemComponent* AbilitySystemComponent = nullptr;
|
UCogSampleAbilitySystemComponent* AbilitySystemComponent = nullptr;
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------
|
|
||||||
// To make sure it doesn't get garbage collected.
|
|
||||||
//---------------------------------------------------------------------------------
|
|
||||||
UPROPERTY()
|
|
||||||
TObjectPtr<UObject> CogWindowManagerRef = nullptr;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UPROPERTY(Replicated)
|
UPROPERTY(Replicated)
|
||||||
float _ServerFramerateRaw = 0.0f;
|
float _ServerFramerateRaw = 0.0f;
|
||||||
|
|
||||||
#if ENABLE_COG
|
#if ENABLE_COG
|
||||||
|
|
||||||
TObjectPtr<UCogSubsystem> CogWindowManager = nullptr;
|
|
||||||
|
|
||||||
float _ClientFramerateSmooth = 0.0f;
|
float _ClientFramerateSmooth = 0.0f;
|
||||||
|
|
||||||
float _ServerFramerateSmooth = 0.0f;
|
float _ServerFramerateSmooth = 0.0f;
|
||||||
|
|||||||
Reference in New Issue
Block a user