1.Unity场景搭建
2.脚本编码
using System.Collections; using System.Collections.Generic; using UnityEngine; public class AudioPlay : MonoBehaviour { //初始化播放对象 public AudioSource audioMgr; void Start() { audioMgr = this.GetComponent<AudioSource>(); //执行播放 audioMgr.Play(); } void Update() { } }
标签:音乐,System,Unity,Collections,using,播放,audioMgr From: https://www.cnblogs.com/clf125800/p/17101757.html