fix:调整青蛙boss整体流程

This commit is contained in:
bzx
2026-01-14 14:18:01 +08:00
parent 9b7b64bbb1
commit 735dc24edc
6 changed files with 70 additions and 12 deletions

View File

@@ -209,7 +209,16 @@ public class FrogEggAttack : Action
float step = fanAngle / (eggCount - 1);
float startAngle = -fanAngle * 0.5f;
for (int i = 0; i < eggCount; i++)
int eggBugCount = boss.GetAliveTentacles().Count;
int insCount;
if (eggBugCount >= 12)
{
boss.Idle();
isFinished = true;
yield break;
}
insCount=12-eggBugCount;
for (int i = 0; i < insCount; i++)
{
float angle = startAngle + step * i;
@@ -291,6 +300,7 @@ public class FrogIdleMove : Action
if (boss.HasAnySkillReady())
{
boss.aiPath.isStopped = true;
boss.Idle();
return TaskStatus.Failure;
}

View File

@@ -1,4 +1,5 @@
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using DragonLi.Core;
using UnityEngine;
@@ -19,6 +20,16 @@ public class FrogBoss : Enemy
public EnemyBoneHit mouthBoneHit;
public List<FrogBugEnemy> frogBugs = new List<FrogBugEnemy>();
public List<FrogBugEnemy> GetAliveTentacles()
{
List<FrogBugEnemy> list = new();
foreach (var t in frogBugs)
if (t != null && !t.isDead)
list.Add(t);
return list;
}
private void Start()
{
clipQuadObj.transform.localPosition = new Vector3(0, -5f, 0);
@@ -157,5 +168,48 @@ public class FrogBoss : Enemy
}
#endregion
#region Die
public override void Dead()
{
if (isDead)
{
return;
}
GameManager.Ins.curLevel++;
isDead = true;
if (bloodSlider != null)
bloodSlider.gameObject.SetActive(false);
if(ColliderComponent!=null)
ColliderComponent.enabled = false;
if(behaviourTree != null)
behaviourTree.enabled = false;
GameManager.Ins.PlaySound3D("1.46",transform);
foreach (var item in GetAliveTentacles())
{
item.Dead();
}
StartCoroutine(DeathDissolve());
}
IEnumerator DeathDissolve()
{
// 1⃣ 停止行为
behaviourTree.enabled = false;
ColliderComponent.enabled = false;
clipQuadObj.SetActive(true);
bloodSlider.gameObject.SetActive(false);
clipQuadObj.transform.localPosition = new Vector3(0, 5f, 0);
bossAnim.SetBool("isDie",true);
yield return new WaitForSeconds(3f);
clipQuadObj.transform.DOLocalMoveY(-5f, 5);
yield return new WaitForSeconds(8f);
GameManager.Ins.CreateBoss(transform.position.ReflectVectorXOZ());
Destroy(gameObject);
}
#endregion
}

View File

@@ -82,7 +82,6 @@ public class OctopusBoss : Enemy
{
return;
}
GameManager.Ins.curLevel++;
//base.Dead();
isDead = true;