.
This commit is contained in:
parent
92fee25afe
commit
447b7f6737
@ -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)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user