31 lines
756 B
C#
31 lines
756 B
C#
using UnityEngine;
|
|
|
|
[RequireComponent(typeof(BoxCollider))]
|
|
public class Projectile_Strait : ProjectileBase
|
|
{
|
|
public eProjectileStrait m_Direction = eProjectileStrait.Forward;
|
|
public float m_Speed = 0f;
|
|
|
|
TrailRenderer[] arr_TR;
|
|
|
|
public override void Off_FisrLoad()
|
|
{
|
|
base.Off_FisrLoad();
|
|
arr_TR = GetComponentsInChildren<TrailRenderer>();
|
|
}
|
|
|
|
public override void Set(ProjectileData _data)
|
|
{
|
|
for (int i = 0; i < arr_TR.Length; i++)
|
|
arr_TR[i].Clear();
|
|
|
|
base.Set(_data);
|
|
if (m_Speed > 0f) m_ProjecTileData.Speed = m_Speed;
|
|
StartCoroutine(Co_Move_Strait(m_Direction));
|
|
}
|
|
|
|
private void Reset()
|
|
{
|
|
GetComponent<BoxCollider>().isTrigger = true;
|
|
}
|
|
} |