1)NGUI中有一个UIPlay Sound脚本
2)创建一个Image->AddComponent->UIPlaySound脚本
3)拖入音频文件到Audio Clip里面,然后再Trigger里面选择Custom,
4)添加代码,
UIPlaySound s = GameObject.Find("Image").GetComponentInChildren<UIPlaySound>();
s.play();
1)NGUI中有一个UIPlay Sound脚本
2)创建一个Image->AddComponent->UIPlaySound脚本
3)拖入音频文件到Audio Clip里面,然后再Trigger里面选择Custom,
4)添加代码,
UIPlaySound s = GameObject.Find("Image").GetComponentInChildren<UIPlaySound>();
s.play();