using UnityEngine;

public class SkillSupport : MonoBehaviour
{
    [HideInInspector] public Transform[] DownHazardFirePos;        // 위에서 아래로 포격
    [HideInInspector] public Transform[] RightHazardFirePos;        // 왼쪽에서 오른쪽으로 포격

    [HideInInspector] public SkillPredict[] DownHazardPredicts;
    [HideInInspector] public SkillPredict[] RightHazardPredicts;

    private void Awake()
    {
        
    }

    private void Start()
    {
        GameObject[] shineDownStartPoss = GameObject.FindGameObjectsWithTag("ShineDownStartPos");
        GameObject[] shineRightStartPoss = GameObject.FindGameObjectsWithTag("ShineRightStartPos");

        DownHazardFirePos = new Transform[shineDownStartPoss.Length];
        DownHazardPredicts = new SkillPredict[shineDownStartPoss.Length];
        RightHazardFirePos = new Transform[shineRightStartPoss.Length];
        RightHazardPredicts = new SkillPredict[shineRightStartPoss.Length];

        for(int i=0;i<DownHazardFirePos.Length;i++)
        {
            DownHazardFirePos[i] = shineDownStartPoss[i].transform;
            SkillPredict skillPredict = shineDownStartPoss[i].GetComponentInChildren<SkillPredict>();
            if(skillPredict != null)
            {
                DownHazardPredicts[i] = skillPredict;
            }

        }
            

        for(int i=0;i<RightHazardFirePos.Length;i++)
        {
            RightHazardFirePos[i] = shineRightStartPoss[i].transform;

            SkillPredict skillPredict = shineRightStartPoss[i].GetComponentInChildren<SkillPredict>();
            if(skillPredict != null)
            {
                RightHazardPredicts[i] = skillPredict;
            }
        }    
    }
}
