Project_WL/Assets/Script/Character/Projectile/Projectile/Projectile_Stop.cs

29 lines
1005 B
C#

using System.Collections;
using UnityEngine;
public class Projectile_Stop : ProjectileBase
{
[Header("적 방향으로 노출 여부")]
public bool ShowTarget = false;
public override void Set(ProjectileData _data)
{
base.Set(_data);
m_ShowTimeOverEffect = false; // 근접 공격은 시간 다 됐을 때 이펙트 표시 x
if (!ShowTarget) transform.eulerAngles = new Vector3(0f, -30f); // x는 폭, z는 앞뒤 길이
else transform.eulerAngles = Vector3.up * transform.eulerAngles.y; // x 방향 등은 제거 (큰 몹은 위에서 아래로 보기 때문)
StartCoroutine(Co_Off(m_ProjecTileData.LifeTime));
}
public void Set_FollowShooter() { StartCoroutine(Co_Follow()); }
IEnumerator Co_Follow()
{
while (true)
{
if (m_ProjecTileData.shooter.isTarget)
transform.position = m_ProjecTileData.shooter.Get_CenterPositionFoward();
yield return null;
}
}
}