using System.Collections; using UnityEngine; public class Skill_DeathBlade : ProjectileBase { public GameObject go_dagger, go_nextattack; [Header("단검 속도")] public float speed = 4f; [Header("단검 유지시간")] public float lifetime = 4f; Coroutine CoStrait, CoOff; public override void Set(ProjectileData _data) { go_dagger.SetActive(true); go_nextattack.SetActive(false); _data.Speed = speed; _data.LifeTime = lifetime; _data.eStartPos = eProjectileStartPos.ShooterCenter; base.Set(_data); CoStrait = StartCoroutine(Co_Move_Strait(eProjectileStrait.Forward)); CoOff = StartCoroutine(Co_Off(lifetime)); _data.Action_OnHit = hitter => { // 단검을 맞췄을 경우 _data.Action_OnHit = null; StopCoroutine(CoStrait); CoStrait = null; StopCoroutine(CoOff); CoOff = null; go_dagger.SetActive(false); InGameInfo.Ins.Show_Effect("Effect_Teleport", _data.shooter.Get_position()); _data.shooter.Set_Invisible(1.0f, () => { _data.shooter.Set_Warp(hitter.Get_PositionBack()); _data.shooter.Play_Skill("bd_skill3_next"); StartCoroutine(Co_JoyStick(hitter)); }); }; } IEnumerator Co_JoyStick(Actor hitter) { OptionInfo.Ins.PCMove = false; yield return new WaitForSeconds(0.2f); go_nextattack.SetActive(true); go_nextattack.transform.position = hitter.Get_Center_position(); yield return new WaitForSeconds(0.3f); OptionInfo.Ins.PCMove = true; yield return new WaitForSeconds(0.5f); Off(true); } }