41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Skill_MultiShot : ProjectileBase
|
|
{
|
|
public Skill_MultiShot_Arrow[] arrows;
|
|
List<MobActor> list_deathmob = new List<MobActor>();
|
|
|
|
public override void Set(ProjectileData _data)
|
|
{
|
|
list_deathmob.Clear();
|
|
_data.eStartPos = eProjectileStartPos.ShooterCenter;
|
|
base.Set(_data);
|
|
transform.rotation = _data.shooter.transform.rotation;
|
|
|
|
_data.LifeTime = 10f;
|
|
|
|
for (int i = 0; i < arrows.Length; i++)
|
|
arrows[i].gameObject.SetActive(false);
|
|
|
|
var arrowcount = IsStep(1) ? 5 : 3;
|
|
for (int i = 0; i < arrowcount; i++)
|
|
arrows[i].Set(_data, IsStep(2), actor =>
|
|
{
|
|
var mob = actor as MobActor;
|
|
if (mob != null && mob.IsDead() && list_deathmob.Find(f => f == mob) == null)
|
|
list_deathmob.Add(mob);
|
|
});
|
|
|
|
StartCoroutine(Co_Off());
|
|
}
|
|
|
|
IEnumerator Co_Off()
|
|
{
|
|
yield return new WaitForSeconds(2f);
|
|
Off();
|
|
if (list_deathmob.Count >= 3)
|
|
ServerInfo.Ins.m_ServerData.Add_TitleCondition(60); // 칭호 : 명사수
|
|
}
|
|
} |