씨발 진짜 뒤질 것 같은데 일단 침착하게 말해보겠음
오브젝트 풀링이라는 방식이 있는데 유니티에서 쓰는 미리 오브젝트를 소환해둔 뒤에 그걸 계속 쓰는 방식으로 이해했거든?
그래서 이걸 구현해볼려고 진짜 온몸 비틀어서 해봤는데 진짜 좆같아서 미치겠음
아래 코드는 내가 그걸 구현해볼려고 한 시도임


using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ObjectPool : MonoBehaviour
{
    public GameObject[] prefab;
    public class PoolListMake
    {
        public List<Queue<GameObject>> PoolList = new List<Queue<GameObject>>();
       
    public PoolListMake(GameObject[] prefabs)
    {
        for (int i = 0; i < prefabs.Length; i++)
        {
            Queue<GameObject> pool = new Queue<GameObject>();
            PoolList.Add(pool);
        }
    }
    }
    PoolListMake poolMaker;

    public GameObject GetObject(int a)
    {
        if(poolMaker == null){
        poolMaker = new PoolListMake(prefab);
        }

        if(poolMaker.PoolList[a].Count > 0)
        {
            GameObject obj = poolMaker.PoolList[a].Dequeue();
            obj.SetActive(true);
            return obj;
        }

        return Instantiate(prefab[a]);
    }
        public void ReturnObject(GameObject obj,int a)
    {
        obj.SetActive(false);
        poolMaker.PoolList[a].Enqueue(obj);
    }

}


그런데 씨발 지금 보니까 좆도 의미 없었고
그냥 어디서 주워올 생각인데
진짜로 마지막으로 혹시 몰라서
오브젝트 풀링 어떻게 해야 잘하는건지 알려주는 영상이나 글 있으면 알려주라
탄환 종류 여러개로 할거라서 그게 되면 더 좋고
일단 나는 구글링해서 외국 유튜브 좀 볼테니 오브젝트 풀링 잘 설명해주는 영상 있으면 알려주라