refactor: change file name

This commit is contained in:
2025-10-11 03:34:03 +02:00
parent be8ea7a497
commit 6be3bf9fa2
2 changed files with 113 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
#include "SkillTreeManager.h"
#include "SkillTreeComponent.h"
#include "Engine/World.h"
#include "Kismet/GameplayStatics.h"
void USkillTreeSubsystem::Initialize(FSubsystemCollectionBase& Collection)
{
Super::Initialize(Collection);
UE_LOG(LogTemp, Log, TEXT("SkillTreeManager: Initialized"));
}
void USkillTreeSubsystem::Deinitialize()
{
Super::Deinitialize();
PlayerSkillTreeComponent = nullptr;
}
USkillTreeSubsystem* USkillTreeSubsystem::GetSkillTreeManager(const UObject* WorldContextObject)
{
if (!WorldContextObject)
{
return nullptr;
}
UGameInstance* GameInstance = UGameplayStatics::GetGameInstance(WorldContextObject);
if (!GameInstance)
{
return nullptr;
}
return GameInstance->GetSubsystem<USkillTreeSubsystem>();
}
void USkillTreeSubsystem::RegisterPlayerSkillTree(USkillTreeComponent* SkillTreeComponent)
{
if (SkillTreeComponent)
{
PlayerSkillTreeComponent = SkillTreeComponent;
UE_LOG(LogTemp, Log, TEXT("SkillTreeManager: Registered player skill tree component"));
}
}
void USkillTreeSubsystem::UnregisterPlayerSkillTree()
{
PlayerSkillTreeComponent = nullptr;
UE_LOG(LogTemp, Log, TEXT("SkillTreeManager: Unregistered player skill tree component"));
}