跳到主要内容

append 添加角色到目标列表中

append

类型: MethodDeclaration

所属类: TargetManager

定义位置: actor.ts

描述

添加角色到目标列表中

参数 actor: 目标角色

参数

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

返回值

类型: void

源代码

位置: 第 5232 行

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)
}
}

文档生成时间:2025/7/7 12:07:06