24 lines
363 B
C#
24 lines
363 B
C#
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
public class ImpactTrigger : MonoBehaviour
|
|||
|
{
|
|||
|
AudioSource source;
|
|||
|
|
|||
|
void Start()
|
|||
|
{
|
|||
|
source = GetComponent<AudioSource>();
|
|||
|
}
|
|||
|
|
|||
|
private void OnTriggerEnter(Collider collider)
|
|||
|
{
|
|||
|
source.Play();
|
|||
|
//Debug.Log("audio.Play Called");
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
|