Skip to main content

append 添加角色到目标列表中

append

类型: MethodDeclaration

所属类: TargetManager

定义位置: actor.ts

描述

添加角色到目标列表中

参数 actor: 目标角色

参数

参数名类型描述默认值
actorActor--

返回值

类型: void

源代码

位置: 第 5516 行

public append(actor: Actor): void {
const index = this.targets.indexOf(actor);
if (index === -1) {
// 如果不存在该目标,则添加目标和仇恨值
// 并让目标角色将本角色添加到相关列表
this.targets.push(actor);
this.threats.push(0);
actor.target.relatedTargets.push(this.actor);
}
}

文档生成时间:2026/2/1 16:51:38