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

30 lines
854 B
C#

using System.Collections;
using UnityEngine;
public class Skill_SpinSlash : Projectile_StopAndColliderControl
{
[Header("이동 속도")]
public float m_speed = 2f;
public override void Set(ProjectileData _data)
{
_data.eStartPos = eProjectileStartPos.ShooterCenter;
base.Set(_data);
LookAt_ShooterFoward();
StartCoroutine(Co_Update());
act_End = () => { Off(true); };
}
IEnumerator Co_Update()
{
yield return new WaitForSeconds(0.5f);
while (true)
{
if (DSUtil.CheckNull(m_ProjecTileData.target)) break;
transform.position = Vector3.MoveTowards(transform.position, m_ProjecTileData.target.Get_position(),
m_speed * Time.deltaTime);
yield return null;
}
}
}