DeltaVR/Assets/Scripts/Breakout/DestroyBallForcefield.cs

17 lines
388 B
C#

using System.Collections;
using System.Collections.Generic;
using Breakout;
using UnityEngine;
public class DestroyBallForcefield : MonoBehaviour
{
private void OnCollisionEnter(Collision other)
{
BreakoutBall ball = other.gameObject.GetComponent<BreakoutBall>();
if (ball == null) return;
Events.ReduceBalls();
Destroy(ball.gameObject);
}
}