using UnityEngine;
using System.Collections;
///
/// 球をタッチしたら、SE再生
///
public class Touch : MonoBehaviour
{
void Update ()
{
Ray ray;
RaycastHit hit;
if(Input.GetMouseButtonDown(0))
{
Camera mainCamera = GameObject.FindWithTag("MainCamera").GetComponent();
ray = mainCamera.ScreenPointToRay(Input.mousePosition);
if(Physics.Raycast(ray, out hit, 100))
{
AudioSource audioSource = GetComponent();
audioSource.Play();
}
}
}
}