一楼大厅优化未完成
This commit is contained in:
@@ -5,6 +5,7 @@ using DG.Tweening;
|
||||
using DragonLi.Core;
|
||||
using DragonLi.Frame;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AI;
|
||||
|
||||
public class DropShip : Enemy
|
||||
{
|
||||
@@ -12,7 +13,7 @@ public class DropShip : Enemy
|
||||
public GameObject player;
|
||||
public Transform[] enemyPos;
|
||||
public Vector3 startPos;
|
||||
|
||||
|
||||
public GameObject bigXl;//大招蓄力特效
|
||||
public GameObject mzObj;//瞄准特效
|
||||
public GameObject damagableObj;//受伤特效
|
||||
@@ -39,8 +40,8 @@ public class DropShip : Enemy
|
||||
}
|
||||
bloodSlider.gameObject.SetActive(false);
|
||||
enemyState = EnemyState.Show;
|
||||
|
||||
GameInit.Ins.PlayAudio("1.8",GameInit.Ins.self.transform,true);
|
||||
|
||||
GameInit.Ins.PlayAudio("1.8", GameInit.Ins.self.transform, true);
|
||||
}
|
||||
|
||||
public override void Attack()
|
||||
@@ -66,13 +67,13 @@ public class DropShip : Enemy
|
||||
components[1].Stop();
|
||||
if (components[2].isDead && components[3].isDead)
|
||||
{
|
||||
Fly();
|
||||
Fly();
|
||||
}
|
||||
else if(!components[2].isDead && components[3].isDead)
|
||||
else if (!components[2].isDead && components[3].isDead)
|
||||
{
|
||||
StartCoroutine(ShootOneAttackMode(2, Fly));
|
||||
}
|
||||
else if(components[2].isDead && !components[3].isDead)
|
||||
else if (components[2].isDead && !components[3].isDead)
|
||||
{
|
||||
StartCoroutine(ShootOneAttackMode(3, Fly));
|
||||
}
|
||||
@@ -81,7 +82,7 @@ public class DropShip : Enemy
|
||||
StartCoroutine(ShootOneAttackMode(2));
|
||||
StartCoroutine(ShootOneAttackMode(3, Fly));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override void TwoAttackMode()
|
||||
@@ -92,19 +93,20 @@ public class DropShip : Enemy
|
||||
|
||||
public void ShowEnemy()
|
||||
{
|
||||
|
||||
for (int i = 0; i < enemyPos.Length; i++)
|
||||
{
|
||||
Vector3 curEnemyPos=new Vector3(enemyPos[i].position.x,0,enemyPos[i].position.z);
|
||||
Vector3 curEnemyPos = new Vector3(enemyPos[i].position.x, 0, enemyPos[i].position.z);
|
||||
GameManager.Ins.CreateCallEnemyEffect(curEnemyPos);
|
||||
}
|
||||
MonoSingleton<CoroutineTaskManager>.Instance.WaitSecondTodo(() =>
|
||||
{
|
||||
for (int i = 0; i < enemyPos.Length; i++)
|
||||
{
|
||||
Vector3 curEnemyPos=new Vector3(enemyPos[i].position.x,0,enemyPos[i].position.z);
|
||||
GameManager.Ins.CreateEnemy(1,curEnemyPos,Vector3.zero,false);
|
||||
Vector3 curEnemyPos = new Vector3(enemyPos[i].position.x, 0, enemyPos[i].position.z);
|
||||
GameManager.Ins.CreateEnemy(1, curEnemyPos, Vector3.zero, false);
|
||||
}
|
||||
},2f);
|
||||
}, 2f);
|
||||
}
|
||||
|
||||
public override void ThreeAttackMode()
|
||||
@@ -144,10 +146,10 @@ public class DropShip : Enemy
|
||||
// 最后一段,直接用预先算好的玩家位置
|
||||
targetPos = playerTarget;
|
||||
}
|
||||
targetPos=new Vector3(targetPos.x, 0f, targetPos.z);
|
||||
targetPos = new Vector3(targetPos.x, 0f, targetPos.z);
|
||||
Debug.Log($"发射第 {i} 发导弹,目标点 = {targetPos}");
|
||||
components[curIndex].EnemyShoot(targetPos);
|
||||
GameInit.Ins.PlayAudio("2.3导弹发射",transform,false);
|
||||
GameInit.Ins.PlayAudio("2.3导弹发射", transform, false);
|
||||
yield return new WaitForSeconds(oneAttackInterval);
|
||||
}
|
||||
|
||||
@@ -155,7 +157,7 @@ public class DropShip : Enemy
|
||||
cb?.Invoke();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override void Show()
|
||||
{
|
||||
base.Show();
|
||||
@@ -166,17 +168,17 @@ public class DropShip : Enemy
|
||||
float endValue = 10;
|
||||
if (GameInit.Ins.gamePlace == GamePlace.HangZhouLongHuTianJie)
|
||||
endValue = 35f;
|
||||
if(GameInit.Ins.gamePlace== GamePlace.Yangzhou_Hanjiang_TansuoZhongxin_wai)
|
||||
if (GameInit.Ins.gamePlace == GamePlace.Yangzhou_Hanjiang_TansuoZhongxin_wai)
|
||||
endValue = 16f;
|
||||
if(GameInit.Ins.gamePlace== GamePlace.Guangzhou_Panyv_Zhanting)
|
||||
if (GameInit.Ins.gamePlace == GamePlace.Guangzhou_Panyv_Zhanting)
|
||||
endValue = -7f;
|
||||
if(GameInit.Ins.gamePlace== GamePlace.Anhui_Wuhu_Guanwei)
|
||||
if (GameInit.Ins.gamePlace == GamePlace.Anhui_Wuhu_Guanwei)
|
||||
endValue = 13f;
|
||||
if(GameInit.Ins.gamePlace== GamePlace.Zhejiang_Jinhua_KeJiGuan)
|
||||
if (GameInit.Ins.gamePlace == GamePlace.Zhejiang_Jinhua_KeJiGuan)
|
||||
endValue = 17f;
|
||||
if(GameInit.Ins.gamePlace== GamePlace.ShanDong_Langfang_QingzhouTaihuacheng)
|
||||
if (GameInit.Ins.gamePlace == GamePlace.ShanDong_Langfang_QingzhouTaihuacheng)
|
||||
endValue = 20f;
|
||||
if(GameInit.Ins.gamePlace== GamePlace.Shandong_Jining_Shangchang_nei)
|
||||
if (GameInit.Ins.gamePlace == GamePlace.Shandong_Jining_Shangchang_nei)
|
||||
endValue = 7f;
|
||||
if (GameInit.Ins.gamePlace == GamePlace.Company1Floor)
|
||||
{
|
||||
@@ -193,7 +195,7 @@ public class DropShip : Enemy
|
||||
_isShow = false;
|
||||
});
|
||||
}
|
||||
if (GameInit.Ins.gamePlace == GamePlace.HangZhouLongHuTianJie||GameInit.Ins.gamePlace== GamePlace.Guangzhou_Panyv_Zhanting )
|
||||
if (GameInit.Ins.gamePlace == GamePlace.HangZhouLongHuTianJie || GameInit.Ins.gamePlace == GamePlace.Guangzhou_Panyv_Zhanting)
|
||||
{
|
||||
transform.DOMoveX(endValue, 4).OnComplete(() =>
|
||||
{
|
||||
@@ -210,7 +212,7 @@ public class DropShip : Enemy
|
||||
}
|
||||
if (GameInit.Ins.gamePlace == GamePlace.Hubei_Xiangyang_Kejiguan)
|
||||
{
|
||||
transform.DOMove(new Vector3(-8.12f,transform.position.y,-3.71f), 4).OnComplete(() =>
|
||||
transform.DOMove(new Vector3(-8.12f, transform.position.y, -3.71f), 4).OnComplete(() =>
|
||||
{
|
||||
isAttack = true;
|
||||
foreach (var item in tailGas)
|
||||
@@ -264,17 +266,17 @@ public class DropShip : Enemy
|
||||
public void Fly()
|
||||
{
|
||||
isShield = true;
|
||||
AnimatorComponent.SetBool("fly",true);
|
||||
GameInit.Ins.PlayAudio("2.11冲刺",transform,false);
|
||||
AnimatorComponent.SetBool("fly", true);
|
||||
GameInit.Ins.PlayAudio("2.11冲刺", transform, false);
|
||||
foreach (var item in tailGas)
|
||||
{
|
||||
item.SetActive(false);
|
||||
}
|
||||
MonoSingleton<CoroutineTaskManager>.Instance.WaitSecondTodo(() =>
|
||||
{
|
||||
isShield=false;
|
||||
isShield = false;
|
||||
StopFly();
|
||||
},3f);
|
||||
}, 3f);
|
||||
}
|
||||
|
||||
public void StopFly()
|
||||
@@ -283,16 +285,16 @@ public class DropShip : Enemy
|
||||
{
|
||||
item.SetActive(true);
|
||||
}
|
||||
AnimatorComponent.SetBool("fly",false);
|
||||
AnimatorComponent.SetBool("fly", false);
|
||||
userSillIng = false;
|
||||
}
|
||||
|
||||
|
||||
public override void Dead()
|
||||
{
|
||||
var pos=transform.position;
|
||||
var pos = transform.position;
|
||||
if (GameInit.Ins.gamePlace == GamePlace.ShanDong_Langfang_QingzhouTaihuacheng)
|
||||
pos = new Vector3(16.6f, 0, 16.2f);
|
||||
if(!isDead)
|
||||
if (!isDead)
|
||||
GameManager.Ins.CurLevelWin(pos);
|
||||
base.Dead();
|
||||
}
|
||||
@@ -326,10 +328,10 @@ public class DropShip : Enemy
|
||||
public override void ChangeHp(float value, object info, Transform _sender)
|
||||
{
|
||||
base.ChangeHp(value, info, _sender);
|
||||
damagableObj.SetActive(health/maxHealth<=0.5f);
|
||||
damagableObj.SetActive(health / maxHealth <= 0.5f);
|
||||
}
|
||||
|
||||
private float enemyTime=45f;
|
||||
|
||||
private float enemyTime = 60f;
|
||||
private float curEnemyTime;
|
||||
public override void Update()
|
||||
{
|
||||
@@ -344,15 +346,15 @@ public class DropShip : Enemy
|
||||
Quaternion targetRotation = Quaternion.LookRotation(targetDir);
|
||||
transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, Time.deltaTime * 2f);
|
||||
}
|
||||
|
||||
curEnemyTime-=Time.deltaTime;
|
||||
|
||||
curEnemyTime -= Time.deltaTime;
|
||||
if (curEnemyTime <= 0)
|
||||
{
|
||||
if (GameManager.Ins.GetCurEnemyListCount() <= 8)
|
||||
if (GameManager.Ins.GetCurEnemyListCount() <= 5)
|
||||
{
|
||||
ShowEnemy();
|
||||
}
|
||||
}
|
||||
curEnemyTime = enemyTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user