// Use this for initialization void Start() { secPerBeat = 60f / song_note.GetBpm(); dspTimeSong = (float)AudioSettings.dspTime; BeatAdvance = 4f; velocity = 28.0f / BeatAdvance * (1.0f * song_note.GetBpm() / 60.0f); // Debug.Log(dspTimeSong); //开始播放音乐 GetComponent <AudioSource>().Play(); }