暂时 解决 血条错位和 打到新产生的怪问题

This commit is contained in:
panw
2025-07-21 10:08:54 +08:00
parent 9fd8fa02af
commit 9b4e9073a2
5 changed files with 39 additions and 30 deletions

View File

@@ -29,7 +29,7 @@ export class MissionMonCompComp extends CCComp {
buffData?: any[] // 使用BuffAttr格式的buff数据
}> = [];
private isSpawning: boolean = false;// 是否正在生成怪物
private spawnInterval: number = 2; // 每个怪物生成间隔时间
private spawnInterval: number = 0.5; // 每个怪物生成间隔时间
private spawnTimer: number = 0; // 生成计时器
private is_fight:boolean = false;
@@ -105,10 +105,9 @@ export class MissionMonCompComp extends CCComp {
// 为每个怪物组生成指定数量的怪物
for (let i = 0; i < count; i++) {
// 随机选择位置 (0-9)
let x=i%3 //0 1 2
this.addToSpawnQueueWithAffixes(
uuid,
x,
i,
isBoss || false,
monsterLevel,
affixes,
@@ -189,10 +188,9 @@ export class MissionMonCompComp extends CCComp {
lv: number = 1,
buffData?: any[]
) {
let x=RandomManager.instance.getRandomInt(0,2)
let mon = ecs.getEntity<Monster>(Monster);
let scale = -1;
let pos: Vec3 = v3(MonSet[x].pos);
let pos: Vec3 = v3(MonSet[i].pos);
// 生成怪物传递词条buff数据
mon.load(pos, scale, uuid, is_boss, is_call, lv, buffData);