TO SQUASH: Fixed issue with bar hit sound being played multiple times.
This commit is contained in:
@@ -18,7 +18,10 @@ public class BallBase : MonoBehaviour
|
|||||||
{
|
{
|
||||||
if(other.gameObject.CompareTag("Bar"))
|
if(other.gameObject.CompareTag("Bar"))
|
||||||
{
|
{
|
||||||
audioSource.PlayOneShot(hitSound);
|
if (!audioSource.isPlaying)
|
||||||
|
{
|
||||||
|
audioSource.PlayOneShot(hitSound);
|
||||||
|
}
|
||||||
|
|
||||||
// Destroy all bar segments when the ball hits a bar.
|
// Destroy all bar segments when the ball hits a bar.
|
||||||
var barSegments = GameObject.FindGameObjectsWithTag("Bar");
|
var barSegments = GameObject.FindGameObjectsWithTag("Bar");
|
||||||
|
|||||||
Reference in New Issue
Block a user