unity3d 播放音乐

来源:互联网 发布:大学网络教育专业 编辑:程序博客网 时间:2024/05/21 17:09
void Awake(){if(player == null){ // try and get it manually if player forgot to assign an AudioSourceplayer = GameObject.Find("AudioSource").GetComponent<AudioSource>();}}
public AudioClip gameOverSoundFx;

player.PlayOneShot(<pre name="code" class="html">gameOverSoundFx
);


0 0
原创粉丝点击