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

37 lines
1017 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Skill_EnergyBall : ProjectileBase
{
[Header("에너지볼 프리팹")]
public string projectile = "Projectile_EnergyBall";
[Header("에너지볼 생성 갯수")]
public int amount = 5;
[Header("에너지볼 생성 간격")]
public float gapTime = 0.1f;
public override void Set(ProjectileData _data)
{
base.Set(_data);
_data.v3_StartPos = _data.shooter.Get_position();
StartCoroutine(Co_Shoot());
}
IEnumerator Co_Shoot()
{
var count = amount;
if (IsStep(1)) count += (int)Get_AwakenData(1, 1);
if (IsStep(2)) count += (int)Get_AwakenData(2, 1);
if (IsStep(3)) count += (int)Get_AwakenData(3, 1);
while (count > 0)
{
ProjectileInfo.Ins.Shoot_Projectile(projectile, m_ProjectTileData);
--count;
yield return new WaitForSeconds(gapTime);
}
Off();
}
}