9#include "Components/WidgetComponent.h"
17 rootSceneComp = CreateDefaultSubobject<USceneComponent>(TEXT(
"rootSceneComp"));
20 speechWidget = CreateDefaultSubobject<UWidgetComponent>(TEXT(
"speechWidget"));
22 speechWidget->SetRelativeLocation(FVector(0.f, 0.f, 40.f));
26 ConstructorHelpers::FClassFinder<UTutorSpeechWidget> speechWidgetClassRef(TEXT(
"/Game/CustomContents/UI/Widgets/OwlTutorBot/WBP_TutorSpeechWidget.WBP_TutorSpeechWidget_C"));
27 if (speechWidgetClassRef.Succeeded())
29 speechWidget->SetWidgetClass(speechWidgetClassRef.Class);
32 meshComp = CreateDefaultSubobject<UStaticMeshComponent>(TEXT(
"meshComp"));
34 meshComp->SetCollisionProfileName(TEXT(
"NoCollision"));
35 meshComp->CanCharacterStepUpOn = ECB_No;
36 ConstructorHelpers::FObjectFinder<UStaticMesh> meshRef(TEXT(
"/Script/Engine.StaticMesh'/Game/CustomContents/Character/Asset/MiniOwl/MiniOwlbot.MiniOwlbot'"));
37 if (meshRef.Succeeded())
39 meshComp->SetStaticMesh(meshRef.Object);
52 Super::Tick(DeltaTime);
59 FVector targetPos = FVector::ZeroVector;
62 SetActorRelativeLocation(targetPos);
70void AMiniOwlBot::ServerRPC_UpdateText_Implementation(
const FString& text)
75void AMiniOwlBot::MulticastRPC_UpdateText_Implementation(
const FString& text)
78 Cast<UTutorSpeechWidget>(
speechWidget->GetWidget())->SetInputText(text);
80 FTimerHandle TimerHandle;
81 GetWorld()->GetTimerManager().SetTimer(TimerHandle, [
this]()
Declares the player-controlled character actor.
YiSan 전반에서 사용하는 공용 인터페이스를 선언합니다.
void MulticastRPC_UpdateText(const FString &text)
TObjectPtr< class USceneComponent > rootSceneComp
virtual void Tick(float DeltaSeconds) override
TObjectPtr< class UStaticMeshComponent > meshComp
TObjectPtr< class UWidgetComponent > speechWidget
virtual void BeginPlay() override
void ServerRPC_UpdateText(const FString &text)
void UpdateText(const FString &text)
void UpdateLocation(float DeltaTime)