MassBattle Docsv1.19.20

IMassBattleActorInterface

UINTERFACE

Source/MassBattle/Public/Interfaces/MassBattleActorInterface.h

概述 Overview

由 MassBattle ActorHost 系统生成的 Actor 所实现的接口(BlueprintType,BlueprintNativeEvent)。声明唯一的出生事件 OnActorSpawn:Actor 被 ActorHost 生成/初始化时调用,载荷为 FOwnerEntity(含生成者 Owner 实体与宿主 Host 实体)。分发点在 UMassBattleHostSubsystem 的实体事件处理段(IMassBattleActorInterface::Execute_OnActorSpawn)。

Interface implemented by Actors spawned by the MassBattle ActorHost system (BlueprintType, BlueprintNativeEvent). Declares the single spawn event OnActorSpawn: called when the Actor is spawned/initialized by the ActorHost, carrying FOwnerEntity (the spawning Owner entity and the Host entity). Dispatched from the entity-event processing section of UMassBattleHostSubsystem (IMassBattleActorInterface::Execute_OnActorSpawn).

接口方法 Interface Methods

OnActorSpawn BlueprintNativeEvent, BlueprintCallable, void

Actor 被 MassBattle ActorHost 生成/初始化时触发。OwnerData 携带所属关系:OwnerEntity = 生成该 Actor 的 agent 单位,HostEntity = 托管它的管理实体。事件由 UMassBattleHostSubsystem 在实体事件队列处理时经 Execute_OnActorSpawn 分发给实现了本接口的 Actor。实现方应在事件内完成 Actor 侧的一次性初始化(绑定实体数据等)。

Triggered when the Actor is spawned/initialized by the MassBattle ActorHost. OwnerData carries the owner linkage: OwnerEntity = the agent that spawned this actor, HostEntity = the manager entity that hosts it. Dispatched by UMassBattleHostSubsystem via Execute_OnActorSpawn while processing its entity event queue. Implementers should perform first-time actor-side initialization inside the event (binding entity data, etc.).

Input
参数 Param类型 Type说明 Description
OwnerDataconst FOwnerEntity&所属关系:OwnerEntity = 生成该 Actor 的 agent 单位,HostEntity = 托管它的管理实体(见 Fragments/OwnerEntity.h)。Owner linkage: OwnerEntity = the agent that spawned this actor, HostEntity = the manager entity that hosts it (see Fragments/OwnerEntity.h).
Output

无返回值。无内置副作用(行为由实现方决定)。

No return value. No built-in side effects (behavior is up to the implementer).

管线角色 Pipeline Role

UMassBattleHostSubsystem(ActorHost)生成 Actor 并压入实体事件队列,在处理队列时对实现了本接口的 Actor 调用 Execute_OnActorSpawn(Actor, OwnerData)(见 MassBattleHostSubsystem.cpp 的事件分发段)。FOwnerEntity 结构定义于 Fragments/OwnerEntity.h。

UMassBattleHostSubsystem (ActorHost) spawns the Actor and enqueues the entity event; while processing the queue it calls Execute_OnActorSpawn(Actor, OwnerData) on Actors implementing this interface (see the event dispatch section of MassBattleHostSubsystem.cpp). The FOwnerEntity struct is defined in Fragments/OwnerEntity.h.