NGUI 播放生音

来源:互联网 发布:入驻淘宝的费用是多少 编辑:程序博客网 时间:2024/04/28 15:06

1)NGUI中有一个UIPlay Sound脚本

2)创建一个Image->AddComponent->UIPlaySound脚本

3)拖入音频文件到Audio Clip里面,然后再Trigger里面选择Custom,

4)添加代码,

UIPlaySound  s = GameObject.Find("Image").GetComponentInChildren<UIPlaySound>();

s.play();

0 0