36 lines
1010 B
C#
36 lines
1010 B
C#
using System.Collections;
|
|
using UnityEngine;
|
|
|
|
public class Skill_Whirlwind : ProjectileBase
|
|
{
|
|
[Header("지속시간")]
|
|
public float lifeTime = 3f;
|
|
[Header("히트 간격 (2배, 0.1이면 0.2)")]
|
|
public float gapTime = 0.1f;
|
|
|
|
public ProjectileHitChecker m_HitChecker;
|
|
|
|
|
|
public override void Set(ProjectileData _data)
|
|
{
|
|
_data.LifeTime = lifeTime;
|
|
base.Set(_data);
|
|
transform.eulerAngles = Vector3.zero;
|
|
StartCoroutine(Co_Update());
|
|
}
|
|
|
|
IEnumerator Co_Update()
|
|
{
|
|
m_HitChecker.gameObject.SetActive(false);
|
|
while (m_ProjectTileData.LifeTime > 0f)
|
|
{
|
|
yield return new WaitForSeconds(gapTime);
|
|
transform.position = m_ProjectTileData.shooter.Get_Center_position();
|
|
m_HitChecker.gameObject.SetActive(true);
|
|
yield return new WaitForSeconds(gapTime);
|
|
m_HitChecker.gameObject.SetActive(false);
|
|
}
|
|
Off(true);
|
|
// 캐릭터 idle로 만들기
|
|
}
|
|
} |