51 lines
1.5 KiB
C#
51 lines
1.5 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Skill_HeavyRain : ProjectileBase
|
|
{
|
|
[Header("스킬 판정 범위")]
|
|
public float area = 15f;
|
|
[Header("스킬 갯수")]
|
|
public int amount = 20;
|
|
[Header("스킬 발사체")]
|
|
public string projectile = "Projectile_HeavyRain";
|
|
|
|
List<ProjectileData> mm = new List<ProjectileData>();
|
|
|
|
public override void Set(ProjectileData _data)
|
|
{
|
|
if (mm.Count == 0)
|
|
{
|
|
for (int i = 0; i < amount + 10; i++)
|
|
mm.Add(new ProjectileData());
|
|
}
|
|
|
|
base.Set(_data);
|
|
StartCoroutine(Co_HeavyRain());
|
|
}
|
|
|
|
IEnumerator Co_HeavyRain()
|
|
{
|
|
int count = amount + (IsStep(1) ? (int)Get_AwakenData(1, 1) : 0) +
|
|
(IsStep(2) ? (int)Get_AwakenData(2, 1) : 0) +
|
|
(IsStep(3) ? (int)Get_AwakenData(3, 1) : 0);
|
|
|
|
while (count > 0)
|
|
{
|
|
--count;
|
|
var enemies = Get_Enemies(m_ProjectTileData.shooter.transform, area);
|
|
if (enemies.Count > 0)
|
|
{
|
|
mm[count].shooter = m_ProjectTileData.shooter;
|
|
mm[count].target = enemies[Random.Range(0, enemies.Count)];
|
|
mm[count].eStartPos = eProjectileStartPos.Custom;
|
|
mm[count].v3_StartPos = mm[count].target.Get_position();
|
|
ProjectileInfo.Ins.Shoot_Projectile(projectile, mm[count]);
|
|
}
|
|
yield return new WaitForSeconds(0.1f);
|
|
}
|
|
|
|
Off(true);
|
|
}
|
|
} |