add:章鱼boss添加章鱼头,调整章鱼贴图 添加消散机制
This commit is contained in:
@@ -103,8 +103,8 @@ public class Enemy : MonoBehaviour
|
||||
{
|
||||
behaviourTree=GetComponent<BehaviorTree>();
|
||||
Data = GameManager.Ins.EnemyDataDic[(int)type];
|
||||
health = Data.Hp;
|
||||
maxHealth = Data.Hp;
|
||||
health = Data.Hp/1000;
|
||||
maxHealth = Data.Hp/1000;
|
||||
bloodSlider.SetName(Data.NameCN);
|
||||
isDead = false;
|
||||
isShowEnd = false;
|
||||
|
||||
@@ -15,7 +15,7 @@ public class OctopusBoss : Enemy
|
||||
public float sprayDuration = 5f;
|
||||
public float sprayAngle = 40f;
|
||||
public float sprayRotateSpeed = 1f; // 插值用
|
||||
|
||||
public GameObject clipQuadObj;
|
||||
|
||||
[Header("Cooldown")]
|
||||
public float skill1Cooldown = 6f;
|
||||
@@ -37,7 +37,9 @@ public class OctopusBoss : Enemy
|
||||
item.SetData(Data);
|
||||
}
|
||||
sprayEx.SetActive(false);
|
||||
//clipQuadObj.SetActive(false);
|
||||
teleportPoints = GameInit.Ins.allBossPos;
|
||||
clipQuadObj.transform.localPosition = new Vector3(0, 5f, 0);
|
||||
}
|
||||
|
||||
public override void Update()
|
||||
@@ -89,17 +91,29 @@ public class OctopusBoss : Enemy
|
||||
|
||||
public override void Dead()
|
||||
{
|
||||
base.Dead();
|
||||
if (isDead)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GameManager.Ins.curLevel++;
|
||||
//base.Dead();
|
||||
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());
|
||||
}
|
||||
|
||||
public ClipQuadProvider dissolve;
|
||||
public Transform clipQuad;
|
||||
public float dissolveDuration = 2f;
|
||||
|
||||
IEnumerator DeathDissolve()
|
||||
{
|
||||
@@ -107,61 +121,16 @@ public class OctopusBoss : Enemy
|
||||
behaviourTree.enabled = false;
|
||||
ColliderComponent.enabled = false;
|
||||
|
||||
// 2️⃣ 从下往上消散
|
||||
Vector3 startPos = clipQuad.position + Vector3.down * 2f;
|
||||
Vector3 endPos = clipQuad.position + Vector3.up * 2f;
|
||||
|
||||
clipQuad.position = startPos;
|
||||
|
||||
float t = 0;
|
||||
while (t < 1f)
|
||||
{
|
||||
t += Time.deltaTime / dissolveDuration;
|
||||
clipQuad.position = Vector3.Lerp(startPos, endPos, t);
|
||||
yield return null;
|
||||
}
|
||||
|
||||
// 3️⃣ 完全消失
|
||||
SpawnEnergyGather();
|
||||
clipQuadObj.SetActive(true);
|
||||
bloodSlider.gameObject.SetActive(false);
|
||||
clipQuadObj.transform.localPosition = new Vector3(0, 5f, 0);
|
||||
|
||||
clipQuadObj.transform.DOLocalMoveY(-5f, 5);
|
||||
yield return new WaitForSeconds(8f);
|
||||
GameManager.Ins.CreateBoss(transform.position.ReflectVectorXOZ());
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
void SpawnEnergyGather()
|
||||
{
|
||||
//Instantiate(energyFxPrefab, transform.position, Quaternion.identity);
|
||||
|
||||
//StartCoroutine(SpawnNewBoss());
|
||||
}
|
||||
|
||||
IEnumerator SpawnNewBoss()
|
||||
{
|
||||
yield return new WaitForSeconds(2f);
|
||||
|
||||
// var newBoss = Instantiate(bossPrefab, transform.position, transform.rotation);
|
||||
// newBoss.PlayAppearDissolve();
|
||||
}
|
||||
|
||||
public void PlayAppearDissolve()
|
||||
{
|
||||
StartCoroutine(AppearDissolve());
|
||||
}
|
||||
|
||||
IEnumerator AppearDissolve()
|
||||
{
|
||||
Vector3 startPos = clipQuad.position + Vector3.up * 2f;
|
||||
Vector3 endPos = clipQuad.position + Vector3.down * 2f;
|
||||
|
||||
clipQuad.position = startPos;
|
||||
|
||||
float t = 0;
|
||||
while (t < 1f)
|
||||
{
|
||||
t += Time.deltaTime / dissolveDuration;
|
||||
clipQuad.position = Vector3.Lerp(startPos, endPos, t);
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ public class Tentacle : Enemy
|
||||
public AnimationClip atkAnim;
|
||||
public AnimationClip spikeAnim;
|
||||
public AnimationClip dieAnim;
|
||||
public AnimationClip hitAnim;
|
||||
|
||||
public Animation anim;
|
||||
|
||||
@@ -249,6 +250,9 @@ public class Tentacle : Enemy
|
||||
if(enemyState== EnemyState.Show)
|
||||
return;
|
||||
base.ChangeHp(value, info, _sender);
|
||||
// anim.clip = hitAnim;
|
||||
// anim.wrapMode = WrapMode.Once;
|
||||
// anim.Play();
|
||||
if(isDead)
|
||||
return;
|
||||
GameManager.Ins.PlaySound3D("1.10",transform);
|
||||
|
||||
@@ -261,7 +261,7 @@ public class GameManager : MonoBehaviour
|
||||
//CreateAICharacter();
|
||||
|
||||
isGamePlay = true;
|
||||
CreateBoss();
|
||||
CreateBoss(GameInit.Ins.allBossPos[0].position);
|
||||
PlayerUIMessage(0);
|
||||
// CoroutineTaskManager.Instance.WaitSecondTodo(() =>
|
||||
// AudioManager.Ins?.SoundPlay("bgm2", true), 10f);
|
||||
@@ -278,7 +278,7 @@ public class GameManager : MonoBehaviour
|
||||
Debug.Log("AI介绍完成,开始游戏正常流程");
|
||||
|
||||
//创建Boss
|
||||
CreateBoss();
|
||||
CreateBoss(GameInit.Ins.allBossPos[0].position);
|
||||
|
||||
PlayerUIMessage(0);
|
||||
CoroutineTaskManager.Instance.WaitSecondTodo(() =>
|
||||
@@ -484,18 +484,9 @@ public class GameManager : MonoBehaviour
|
||||
CurEnemyDie();
|
||||
}
|
||||
|
||||
public void CreateBoss()
|
||||
public void CreateBoss(Vector3 startPos)
|
||||
{
|
||||
Transform data = GameInit.Ins.allBossPos[curLevel];
|
||||
GameObject door = null;
|
||||
if (curLevel != 0)
|
||||
door = CreateEnemyDoor(data.position, data.eulerAngles, data.localScale);
|
||||
switch (curLevel)
|
||||
{
|
||||
case 0:
|
||||
CreateEnemy(0, data.position, Vector3.zero, true);
|
||||
break;
|
||||
}
|
||||
CreateEnemy(curLevel, startPos, Vector3.zero, true);
|
||||
}
|
||||
|
||||
public void WinEndGame()
|
||||
|
||||
Reference in New Issue
Block a user