void SpecialShoot()
{
if(nowSpecialShoot == false)
{
if (Input.GetMouseButtonDown(1))
{
while ( count <= 2)
{
if(tum >= maxTum)
{
GameObject bullet = Instantiate(preFabBullet);
bullet.transform.position = bulletPos.transform.position;
bullet.gameObject.GetComponent<Rigidbody2D>().AddForce(dir * bulletSpeed, ForceMode2D.Impulse);
count++;
tum = 0f;
}
}
nowSpecialShoot = true;
specialShootDelay = 0f;
count = 0;
}
}
}
슝슝슝 쏘게할려고 했는데 터짐 ㅅㅂ
마우스 버튼을 누를때 while문이 빠져나오질 못해서 그러는듯
코루틴으로 처리 혹은 Invoke로 처리해야 할듯
거기에 총알같이 자주 생성 삭제 되는 오브젝트들은 오브젝트 풀링 해주는게 좋다