This commit is contained in:
LeeJaeHyun 2024-09-12 14:26:13 +09:00
parent 92fee25afe
commit 447b7f6737

View File

@ -5,15 +5,21 @@ using UnityEngine;
public class Barrel : MonoBehaviour public class Barrel : MonoBehaviour
{ {
private GameObject expEffect; private GameObject expEffect;
private int hitCount = 0;
void Start() void Start()
{ {
expEffect = Resources.Load<GameObject>("BigExplosion"); expEffect = Resources.Load<GameObject>("BigExplosion");
} }
// Update is called once per frame void OnCollisionEnter(Collision coll)
void Update()
{ {
if (coll.collider.CompareTag("BULLET"))
{
if (++hitCount == 3)
{
}
}
} }
} }