viewimage.php?id=2abcdd23dad63db0&no=24b0d769e1d32ca73cec8efa11d02831ed3c848cabfee483347b0cb094a503c5604945fad70abe29fde12006610cb688a071e236e9c3ce8af2b8a668997e2e6811e54f


viewimage.php?id=2abcdd23dad63db0&no=24b0d769e1d32ca73cec8efa11d02831ed3c848cabfee483347b0cb094a503c5604945fad70abe29fde12006610cb688a071e236e9c3ce8ea1e6f4699e2d7868e58924


소환물 프리팹을 SummonPoint에서 랜덤으로 뽑아서 소환하도록 바꿨고

그렇게 하니까 isExistEntity(), 내 코드에선 IsExistDice() 부분에서 이상해서 걍 바꿈


public class SummonPoint : MonoBehaviour

{

    public GameObject[] diceObjects;

    public GameObject[] bulletObjects;

    public Transform[] shotPoints;

    public int shotPointChk;


    public float maxSpawnDelay;

    public float curSpawnDelay;


    private int randomDice;

    private bool isDice = false;


    void Update()

    {

        curSpawnDelay += Time.deltaTime;

        if (curSpawnDelay > maxSpawnDelay)

        {

            if (IsExistDice())

            {

                spawnBullet();

                maxSpawnDelay = 1f;

                curSpawnDelay = 0;

            }


        }


    }


    public GameObject SummonOnPoint()

    {

        randomDice = Random.Range(0, diceObjects.Length);

        isDice = true;

        return diceObjects[randomDice] = Instantiate(diceObjects[randomDice], transform.position, transform.rotation);

    }


    void spawnBullet()

    {

        int randomBullet = Random.Range(0, 1);

        int randomPoint = Random.Range(0, 1);


        Instantiate(bulletObjects[randomBullet], shotPoints[randomPoint].position, shotPoints[randomPoint].rotation);

    }


    public void DeleteDice()

    {

        if (diceObjects[randomDice])

        {

            Destroy(diceObjects[randomDice]);

            diceObjects[randomDice] = null;

        }

    }


    public bool IsExistDice()

    {

        return isDice;

    }

}


그리고 이게 소환 버튼에 들어가는 코드

아마 SummonAction이 SummonDice고

SummonButton이 Summon임


public class Summon : MonoBehaviour

{

    public SummonPoint[] summonPoints;

    public void SummonDice()

    {

        int randomPoint = Random.Range(0, summonPoints.Length);


        if (summonPoints[randomPoint].IsExistDice())

        {

            SummonDice();

        }

        else

        {

            summonPoints[randomPoint].SummonOnPoint();

        }

    }

}


암튼 덕분에 해결했다 진짜 고마워 ㅜㅜ 난 이제 보고서 써서 제출해야겠다!