Source, config, and docs only — UE template assets stay local to save storage. Co-authored-by: Cursor <cursoragent@cursor.com>
31 lines
727 B
C++
31 lines
727 B
C++
// Copyright VocationLife Project. All Rights Reserved.
|
|
|
|
#include "VocationPlayerState.h"
|
|
#include "Net/UnrealNetwork.h"
|
|
|
|
AVocationPlayerState::AVocationPlayerState()
|
|
{
|
|
bReplicates = true;
|
|
}
|
|
|
|
void AVocationPlayerState::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
|
|
{
|
|
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
|
|
DOREPLIFETIME(AVocationPlayerState, ActiveVocation);
|
|
DOREPLIFETIME(AVocationPlayerState, Health);
|
|
DOREPLIFETIME(AVocationPlayerState, MaxHealth);
|
|
}
|
|
|
|
void AVocationPlayerState::SetActiveVocation(EVocationLifeClass NewVocation)
|
|
{
|
|
if (HasAuthority())
|
|
{
|
|
ActiveVocation = NewVocation;
|
|
OnRep_ActiveVocation();
|
|
}
|
|
}
|
|
|
|
void AVocationPlayerState::OnRep_ActiveVocation()
|
|
{
|
|
}
|