こんにちは私は3Dオブジェクトをクリックして出力するようにしていますが、何も起こりません。ARオブジェクトがクリックされたときに音声を出力します
私は私のARCamera上でこのスクリプトを添付しました:これがどこに実装されます一度ここで
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraTest1 : MonoBehaviour {
// Use this for initialization
void Start() {
}
// Update is called once per frame
void Update() {
if (Input.GetMouseButton(0) || Input.GetMouseButtonDown(0))
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if (Physics.Raycast(ray, out hit))
{
if (hit.collider.tag == "clickableObject")
{
GameObject obj = GameObject.FindGameObjectWithTag("clickableObject");
obj.GetComponent<AudioSource>().Play();
}
}
}
}
}
は私Object Inspector とARCamera Inspector
だ、私はときのように(もタッチ入力を取得することになりますオブジェクトがタッチされると音が鳴るのですか?)