I have sound source and my question is how can I play that sound when my cube hit a wall? My code:
usingUnityEngine;
usingSystem.Collections;
public class sound : MonoBehaviour {
public AudioSource soundEffect;
voidOnTriggerEnter (Collider other)
{
if(other.gameObject.tag == "wall")
{
soundEffect.Play ();
}
}
}
我可以把视听来源分派给检查员。 我可以把我的<代码>*>。
怎么办?
成就