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

32 lines
806 B
C#

using System.Collections;
using UnityEngine;
public class Skill_MultiShot : ProjectileBase
{
[Header("지속 시간")]
public float lifetime = 10f;
[Header("추가 화살 갯수")]
public int addarrow = 2;
[Header("데미지 감소량")]
public double reducedmg = 0.2d;
public override void Set(ProjectileData _data)
{
base.Set(_data);
m_LifeTime = lifetime;
_data.shooter.Buff_or_Debuff(eCC.MultiShot, m_LifeTime, reducedmg, addarrow);
StartCoroutine(Co_Update());
}
IEnumerator Co_Update()
{
while (m_LifeTime > 0f)
{
yield return null;
m_LifeTime -= Time.deltaTime;
transform.position = m_ProjecTileData.shooter.Get_Center_position();
}
Off(true);
}
}