26 lines
463 B
C#
26 lines
463 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class Barrel : MonoBehaviour
|
|
{
|
|
private GameObject expEffect;
|
|
private int hitCount = 0;
|
|
|
|
void Start()
|
|
{
|
|
expEffect = Resources.Load<GameObject>("BigExplosion");
|
|
}
|
|
|
|
void OnCollisionEnter(Collision coll)
|
|
{
|
|
if (coll.collider.CompareTag("BULLET"))
|
|
{
|
|
if (++hitCount == 3)
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|