using System.Collections; using System.Collections.Generic; using UnityEngine; public class BossMobActor : MobActor { public List list_indicator; protected bool CanUseSkill1, CanUseSkill2; protected float CoolTime_Skill1, CoolTime_Skill2; int m_attackIndex = 0, m_maxAttackIndex; float m_attackspeed; protected override void Awake() { base.Awake(); Init(); } void Init() { list_indicator.ForEach(f => f.SetActive(false)); } protected override void Update() { base.Update(); if (IsDead()) return; } public override void Del_Target(bool forcedel = false) { base.Del_Target(forcedel); if (!isTarget) Init(); } public override void Indicator(int a) { base.Indicator(a); var index = 0; if (isPlaying(eAnim.Attack2)) index = 1; else if (isPlaying(eAnim.Attack3)) index = 2; list_indicator[index].SetActive(a == 0); if (a == 1) { // 데미지 투사체 생성 m_animation.speed = m_attackspeed; var startpos = Get_CenterPositionFoward(); if (ProjectileInfo.ProjectileInfoOn) { if (index == 0) ProjectileInfo.Ins.Shoot_Projectile(m_MonsterTableData.s_Porjectile1, this, m_Target, 1f, startpos, m_MonsterTableData.f_ProjectileLifeTime1); else if (index == 1) ProjectileInfo.Ins.Shoot_Projectile(m_MonsterTableData.s_Porjectile2, this, m_Target, 1f, startpos, m_MonsterTableData.f_ProjectileLifeTime2); else ProjectileInfo.Ins.Shoot_Projectile(m_MonsterTableData.s_Porjectile3, this, m_Target, 1f, startpos, m_MonsterTableData.f_ProjectileLifeTime3); } Set_Coroutine_withCancel(() => { Change_MobStatus(eMobStatus.PatrolWait); ++m_attackIndex; if (m_attackIndex >= m_maxAttackIndex) m_attackIndex = 0; }, 0.95f - m_animation.GetCurrentAnimatorStateInfo(0).normalizedTime); } } public override void Get_Damage(DamageInfo _dinfo) { base.Get_Damage(_dinfo); if (!CanUseSkill1) CanUseSkill1 = (Get_HP() / Get_MaxHP()) <= 0.9; if (!CanUseSkill2) CanUseSkill2 = (Get_HP() / Get_MaxHP()) <= 0.7; } protected override void Set_Die() { base.Set_Die(); Init(); } protected override void On_NavMeshAgent() { base.On_NavMeshAgent(); Init(); } }