52 lines
1.4 KiB
C#
52 lines
1.4 KiB
C#
using System.Collections;
|
|
using UnityEngine;
|
|
|
|
public class Skill_DaggerThrow : ProjectileBase
|
|
{
|
|
[Header("단검 속도")]
|
|
public float DaggerSpeed = 7f;
|
|
|
|
public GameObject[] gos; // 0 한 개, 1 아홉 개
|
|
public Transform tf_one;
|
|
public Transform[] tfs_nine;
|
|
|
|
public override void Set(ProjectileData _data)
|
|
{
|
|
_data.eStartPos = eProjectileStartPos.ShooterCenter;
|
|
_data.LifeTime = 4f;
|
|
_data.Speed = DaggerSpeed;
|
|
base.Set(_data);
|
|
|
|
if (IsStep(1)) Set_ReduceCoolTime_byStep(1);
|
|
m_ProjecTileData.e_SkillExtraType = IsStep(2) ? eSkillExtraType.Blood : eSkillExtraType.None;
|
|
if (IsStep(3))
|
|
{
|
|
DSUtil.InActivateGameObjects(gos, 1);
|
|
StartCoroutine(Co_Update());
|
|
}
|
|
else
|
|
{
|
|
DSUtil.InActivateGameObjects(gos, 0);
|
|
StartCoroutine(Co_Move_Strait(eProjectileStrait.Forward));
|
|
}
|
|
}
|
|
|
|
IEnumerator Co_Update()
|
|
{
|
|
for (int i = 0; i < tfs_nine.Length; i++)
|
|
tfs_nine[i].localPosition = Vector3.zero;
|
|
|
|
while (m_ProjecTileData.LifeTime > 0f)
|
|
{
|
|
if (DSUtil.CheckNull(m_ProjecTileData.shooter)) break;
|
|
|
|
for (int i = 0; i < tfs_nine.Length; i++)
|
|
tfs_nine[i].Translate(m_ProjecTileData.Speed * Time.deltaTime * tfs_nine[i].forward);
|
|
|
|
m_ProjecTileData.LifeTime -= Time.deltaTime;
|
|
yield return null;
|
|
}
|
|
|
|
Off();
|
|
}
|
|
} |