// © 2024 Long Ly. All rights reserved. Any unauthorized use, reproduction, or distribution of this trademark is strictly prohibited and may result in legal action. #include "Player/OLSPlayerState.h" #include "AbilitySystem/OLSAbilitySystemComponent.h" #include "Player/OLSPlayerController.h" AOLSPlayerState::AOLSPlayerState(const FObjectInitializer& objectInitializer) : Super(objectInitializer) { // Create attribute sets here. } void AOLSPlayerState::PostInitializeComponents() { Super::PostInitializeComponents(); check(AbilitySystemComponent); AbilitySystemComponent->InitAbilityActorInfo(this, GetPawn()); const TObjectPtr world = GetWorld(); if (world && world->IsGameWorld() && world->GetNetMode() != NM_Client) { const TObjectPtr gameState = GetWorld()->GetGameState(); check(gameState); // ULyraExperienceManagerComponent* ExperienceComponent = GameState->FindComponentByClass(); // check(ExperienceComponent); // ExperienceComponent->CallOrRegister_OnExperienceLoaded(FOnLyraExperienceLoaded::FDelegate::CreateUObject(this, &ThisClass::OnExperienceLoaded)); } } AOLSPlayerController* AOLSPlayerState::GetOLSPlayerController() const { return Cast(GetOwner()); } UOLSAbilitySystemComponent* AOLSPlayerState::GetOLSAbilitySystemComponent() const { return AbilitySystemComponent; }