【发布时间】:2014-06-20 11:27:00
【问题描述】:
我试图在播放器输入触发器时播放 AudioSource,但由于某种原因没有任何效果。
我在硬币上有一个音频源,玩家将拾取它,并且该音频源附有声音。
using UnityEngine;
using System.Collections;
public class DingSoundPlay : MonoBehaviour {
public AudioSource DingAudioSource;
void OnTriggerEnter (Collider other)
{
if (other.tag == "Player")
{
DingAudioSource.Play();
Debug.Log ("Sound Played");
}
}
}
我做错了什么??
【问题讨论】: