42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
using System.Collections;
|
|
using TrailsFX.Demos;
|
|
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_ProjecTileData.shooter.Set_JoystickStatus(2);
|
|
m_HitChecker.gameObject.SetActive(false);
|
|
while (m_ProjecTileData.LifeTime > 0f)
|
|
{
|
|
yield return new WaitForSeconds(gapTime);
|
|
m_ProjecTileData.LifeTime -= gapTime;
|
|
transform.position = m_ProjecTileData.shooter.Get_Center_position();
|
|
m_HitChecker.gameObject.SetActive(true);
|
|
|
|
yield return new WaitForSeconds(gapTime);
|
|
m_ProjecTileData.LifeTime -= gapTime;
|
|
m_HitChecker.gameObject.SetActive(false);
|
|
}
|
|
Off(true);
|
|
m_ProjecTileData.shooter.Set_JoystickStatus(3);
|
|
m_ProjecTileData.shooter.Play_Idle();
|
|
}
|
|
} |