主界面添加,许多bug修复。祝贺黑盒1如期开始
This commit is contained in:
@@ -5,6 +5,7 @@ using System.IO;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.Audio;
|
||||
|
||||
public class BgmPlaybackManager : MonoBehaviour
|
||||
{
|
||||
@@ -12,6 +13,7 @@ public class BgmPlaybackManager : MonoBehaviour
|
||||
|
||||
[Header("Audio")]
|
||||
public AudioSource audioSource;
|
||||
public AudioMixerGroup outputMixerGroup;
|
||||
public AudioClip clip;
|
||||
[Tooltip("Optional playlist. If empty, will load all clips in Resources/BGM.")]
|
||||
public List<AudioClip> playlist = new List<AudioClip>();
|
||||
@@ -49,6 +51,9 @@ public class BgmPlaybackManager : MonoBehaviour
|
||||
if (audioSource == null)
|
||||
audioSource = gameObject.AddComponent<AudioSource>();
|
||||
|
||||
if (outputMixerGroup != null)
|
||||
audioSource.outputAudioMixerGroup = outputMixerGroup;
|
||||
|
||||
audioSource.playOnAwake = false;
|
||||
audioSource.loop = loop;
|
||||
|
||||
@@ -96,6 +101,9 @@ public class BgmPlaybackManager : MonoBehaviour
|
||||
if (audioSource == null)
|
||||
audioSource = gameObject.AddComponent<AudioSource>();
|
||||
|
||||
if (outputMixerGroup != null)
|
||||
audioSource.outputAudioMixerGroup = outputMixerGroup;
|
||||
|
||||
audioSource.loop = loop;
|
||||
|
||||
if (audioSource.clip == null && clip != null)
|
||||
|
||||
Reference in New Issue
Block a user