33 lines
894 B
C++
33 lines
894 B
C++
#include "PlayerImpostor.h"
|
|
|
|
#include "NakedDesireCharacter.h"
|
|
#include "Kismet/GameplayStatics.h"
|
|
#include "NakedDesire/Clothing/ClothingManager.h"
|
|
#include "NakedDesire/Clothing/ClothingVisualsComponent.h"
|
|
|
|
|
|
APlayerImpostor::APlayerImpostor()
|
|
{
|
|
PrimaryActorTick.bCanEverTick = false;
|
|
|
|
RootSceneComponent = CreateDefaultSubobject<USceneComponent>(TEXT("Root"));
|
|
SetRootComponent(RootSceneComponent);
|
|
|
|
Mesh = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("RootMesh"));
|
|
Mesh->SetupAttachment(RootComponent);
|
|
|
|
ClothingVisualsComponent = CreateDefaultSubobject<UClothingVisualsComponent>(TEXT("Clothing Visuals Component"));
|
|
}
|
|
|
|
void APlayerImpostor::BeginPlay()
|
|
{
|
|
Super::BeginPlay();
|
|
|
|
Player = Cast<ANakedDesireCharacter>(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0));
|
|
if (!Player)
|
|
{
|
|
return;
|
|
}
|
|
|
|
ClothingVisualsComponent->Initialize(GetMesh(), Player->ClothingManager);
|
|
} |