diff --git a/Assets/02_Scripts/Barrel.cs b/Assets/02_Scripts/Barrel.cs index cb7449b..72ba7df 100644 --- a/Assets/02_Scripts/Barrel.cs +++ b/Assets/02_Scripts/Barrel.cs @@ -5,15 +5,21 @@ using UnityEngine; public class Barrel : MonoBehaviour { private GameObject expEffect; + private int hitCount = 0; void Start() { expEffect = Resources.Load("BigExplosion"); } - // Update is called once per frame - void Update() + void OnCollisionEnter(Collision coll) { + if (coll.collider.CompareTag("BULLET")) + { + if (++hitCount == 3) + { + } + } } }