237885e3b8
- SystemDriver: EffectManager改为值持有,去掉TUniquePtr和条件编译 - SystemDriver: 补充EngineUtils.h include修复TActorIterator编译错误 - GameMode: BeginPlay自动Spawn ASystemDriver - InteractableActor: 改为abstract基类,子类自行创建交互组件 - DoorActor: 创建DoorInteractableComp替代基类组件 - EffectManager: 实现ExecuteToggleDoor调用实际门开关逻辑 - InteractableComponent/DoorComponent: 修复GetGameInstance路径和调用方式 - EffectManager: Broadcast改为Execute(单播委托)
37 lines
1.2 KiB
C++
37 lines
1.2 KiB
C++
// 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)
|
||
{
|
||
// 默认空实现,子类可覆盖
|
||
}
|