Project_WL/Assets/Script/Character/Projectile/Skill/Skill_CrossSlash.cs

38 lines
1.3 KiB
C#
Raw Normal View History

2025-02-05 04:06:01 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Skill_CrossSlash : ProjectileBase
{
2025-02-05 04:45:09 +00:00
public ProjectileHitChecker[] arr_ProjectileHitChecker; // 베기 이펙트 2종
2025-02-05 04:06:01 +00:00
public List<float> list_gaptime = new List<float> { 0.25f, 0.4f, 0.35f, 0.425f, 0.45f, 0.45f };
public override void Set(ProjectileData _data)
{
2025-02-05 04:45:09 +00:00
_data.eStartPos = eProjectileStartPos.ShooterCenter;
2025-02-05 04:06:01 +00:00
base.Set(_data);
2025-02-05 04:45:09 +00:00
LookAt_ShooterFoward();
2025-02-05 04:06:01 +00:00
StartCoroutine(Co_Update());
}
IEnumerator Co_Update()
{
2025-02-05 04:45:09 +00:00
for (int i = 0; i < arr_ProjectileHitChecker.Length; i++)
arr_ProjectileHitChecker[i].gameObject.SetActive(false);
2025-02-05 04:06:01 +00:00
m_ProjecTileData.shooter.AnimationPlay("paladin_skill2_start");
for (int i = 0; i < 6; i++)
{
yield return new WaitForSeconds(list_gaptime[i]);
2025-02-05 04:45:09 +00:00
var index = i % 2;
arr_ProjectileHitChecker[index].gameObject.SetActive(false);
arr_ProjectileHitChecker[index].gameObject.SetActive(true);
arr_ProjectileHitChecker[index].Get_Collider().enabled = true;
yield return null;
arr_ProjectileHitChecker[index].Get_Collider().enabled = false;
2025-02-05 04:06:01 +00:00
}
yield return new WaitForSeconds(2f);
Off(true);
}
}