Files
ChildHood/Source/ChildHood/Interaction/InteractableActor.cpp
T
starmen1265 237885e3b8 fix(interaction): 修复编译错误和交互系统集成问题
- SystemDriver: EffectManager改为值持有,去掉TUniquePtr和条件编译
- SystemDriver: 补充EngineUtils.h include修复TActorIterator编译错误
- GameMode: BeginPlay自动Spawn ASystemDriver
- InteractableActor: 改为abstract基类,子类自行创建交互组件
- DoorActor: 创建DoorInteractableComp替代基类组件
- EffectManager: 实现ExecuteToggleDoor调用实际门开关逻辑
- InteractableComponent/DoorComponent: 修复GetGameInstance路径和调用方式
- EffectManager: Broadcast改为Execute(单播委托)
2026-06-12 00:51:00 +08:00

37 lines
1.2 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// ChildHood Project - 通用交互物 Actor 基类 实现(v1.1 Effect/Action 架构)
#include "Interaction/InteractableActor.h"
#include "Interaction/InteractableComponent.h"
#include "Components/StaticMeshComponent.h"
// ============================================================================
// 构造函数
// ============================================================================
AInteractableActor::AInteractableActor()
{
PrimaryActorTick.bCanEverTick = false;
// 创建 Mesh 为根组件
MeshComp = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("MeshComp"));
RootComponent = MeshComp;
MeshComp->SetCollisionProfileName(TEXT("BlockAll"));
// InteractableComp 由子类创建(本类为 abstract)
}
// ============================================================================
// 交互回调
// ============================================================================
void AInteractableActor::OnInteractStarted_Implementation(UInteractableComponent* Comp)
{
// 默认空实现,子类可覆盖(如 ADoorActor 旋转 Mesh)
}
void AInteractableActor::OnInteractEnded_Implementation(UInteractableComponent* Comp)
{
// 默认空实现,子类可覆盖
}