Files
XMen/Assets/Scripts/Enemy/EnemyTa/EnemyTa.cs

55 lines
1.4 KiB
C#

using System.Collections;
using System.Collections.Generic;
using DragonLi.Core;
using DragonLi.Frame;
using UnityEngine;
public class EnemyTa : Enemy,IDamagable
{
public Transform[] enemyPos;
public Transform bossPos;
public Transform bossDoorPos;
public override void Init()
{
base.Init();
for (int i = 0; i < enemyPos.Length; i++)
{
var go=GameManager.Ins.CreateEnemy(1,enemyPos[i].position,Vector3.zero,false);
go.GetComponent<Enemy1>().SetShowWaitTime(4);
}
var boss = GameManager.Ins.CreateEnemy(7,bossPos.position,Vector3.zero, true);
boss.GetComponent<Boss>().FirstShow(GameManager.Ins.BossPosDataDic[0].DoorPos);
isShield = true;
MonoSingleton<CoroutineTaskManager>.Instance.WaitSecondTodo(() =>
{
isShield = false;
},6f);
isDie = false;
}
public override void ChangeHp(float value, object info, Transform _sender)
{
base.ChangeHp(value, info, _sender);
}
public bool isDie;
public override void Update()
{
base.Update();
if (GameManager.Ins.GetCurEnemyListCount() <= 0&& !isDie)
{
Dead();
}
}
public override void Dead()
{
base.Dead();
isDie = true;
GameManager.Ins.CurLevelWin();
GameInit.Ins.PlayAudio("1.7",GameInit.Ins.self.transform,true);
}
}