【发布时间】:2015-12-21 15:23:14
【问题描述】:
就我而言:- 我将在 1 个场景 UNITY 中制作多个声音增强现实,但现在我只能在一个场景 Unity 中制作 1 个声音:-
我在带有音频源的 AR 相机上做到了
和声音脚本:
using UnityEngine;
using System.Collections;
public class DolSound : MonoBehaviour {
public Transform target2;
public AudioSource suaradol;
void Start () {
}
void Update(){
if(Input.GetMouseButton(0)){
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if(Physics.Raycast(ray, out hit)){
if(hit.transform == target2){
suaradol.GetComponent<AudioSource>().Play();
}
}
}
}
}
请教我步骤和脚本在 1 个场景 UNITY 中制作多个声音增强现实
【问题讨论】: