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(单播委托)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// ChildHood Project - 通用交互物 Actor 基类(v1.1 Effect/Action 架构)
|
||||
// 对应技术方案: docs/technical/交互系统-技术方案.md 第3节(类设计)
|
||||
// 职责:持有 Mesh + InteractableComponent,提供可被子类覆盖的交互回调
|
||||
// 核心变更(v0.1 → v1.1):去除门旋转逻辑,只保留干净的基类
|
||||
// 职责:持有 Mesh,提供可被子类覆盖的交互回调
|
||||
// 注意:本类为 abstract,子类必须自行创建并赋值 InteractableComp
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -15,17 +15,14 @@ class UStaticMeshComponent;
|
||||
/**
|
||||
* AInteractableActor
|
||||
*
|
||||
* 通用交互物 Actor 基类。场景中的每个交互物(冰箱、门、NPC 等)
|
||||
* 均为该类的实例或其子类的实例。
|
||||
* 交互物 Actor 抽象基类。提供 Mesh 和交互回调框架。
|
||||
* 子类必须在构造函数中创建合适的 InteractableComponent 并赋值给 InteractableComp。
|
||||
*
|
||||
* 组成:
|
||||
* - UStaticMeshComponent* MeshComp(根组件,承载可视模型)
|
||||
* - UInteractableComponent* InteractableComp(交互逻辑与数据)
|
||||
*
|
||||
* 子类可覆盖 OnInteractStarted / OnInteractEnded 以实现类型特定行为,
|
||||
* 如门开关时的 Mesh 旋转(ADoorActor)、拾取物的消失效果等。
|
||||
* - UInteractableComponent* InteractableComp(由子类创建)
|
||||
*/
|
||||
UCLASS()
|
||||
UCLASS(abstract)
|
||||
class AInteractableActor : public AActor
|
||||
{
|
||||
GENERATED_BODY()
|
||||
@@ -70,7 +67,10 @@ protected:
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components", meta = (AllowPrivateAccess = "true"))
|
||||
TObjectPtr<UStaticMeshComponent> MeshComp;
|
||||
|
||||
/** 交互物的交互组件(数据 + 检测 + 状态) */
|
||||
/**
|
||||
* 交互物的交互组件(数据 + 检测 + 状态)。
|
||||
* 由子类在构造函数中创建并赋值。
|
||||
*/
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components", meta = (AllowPrivateAccess = "true"))
|
||||
TObjectPtr<UInteractableComponent> InteractableComp;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user