|  |  |  | 
|---|
|  |  |  | using System.Collections.Generic; | 
|---|
|  |  |  | using UnityEngine; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | using vnxbqy.UI; | 
|---|
|  |  |  | using System; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public class SoundPlayer : MonoBehaviour | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void UnLoadMusic(int _exclude) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | if (!AssetSource.audioFromEditor && DeviceUtility.IsLowMemory()) | 
|---|
|  |  |  | if (AssetSource.isUseAssetBundle && DeviceUtility.IsLowMemory()) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | foreach (var key in musicAudioClipDict.Keys) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | if (key != _exclude) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | var config = AudioConfig.Get(key); | 
|---|
|  |  |  | AssetBundleUtility.Instance.UnloadAsset("audio/music", config.Audio); | 
|---|
|  |  |  | ResManager.Instance.UnloadAsset("Audio/" + config.Folder, config.Audio); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void PlayLoginMusic() | 
|---|
|  |  |  | { | 
|---|
|  |  |  | var loginMusic = BuiltInLoader.LoadMusic("Music_Login"); | 
|---|
|  |  |  | if (!m_MusicAudioSource.isPlaying || m_MusicAudioSource.clip != loginMusic) | 
|---|
|  |  |  | { | 
|---|
|  |  |  | StartCoroutine(Co_BackGroundMusicFadeOutIn(loginMusic, false)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //public void PlayLoginMusic() | 
|---|
|  |  |  | //{ | 
|---|
|  |  |  | //    var loginMusic = BuiltInLoader.LoadMusic("Music_Login"); | 
|---|
|  |  |  | //    if (!m_MusicAudioSource.isPlaying || m_MusicAudioSource.clip != loginMusic) | 
|---|
|  |  |  | //    { | 
|---|
|  |  |  | //        StartCoroutine(Co_BackGroundMusicFadeOutIn(loginMusic, false)); | 
|---|
|  |  |  | //    } | 
|---|
|  |  |  | //} | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private void LateUpdate() | 
|---|
|  |  |  | { | 
|---|
|  |  |  | // if (CameraController.Instance != null && CameraController.Instance.CameraObject != null) | 
|---|
|  |  |  | // { | 
|---|
|  |  |  | //     this.transform.position = CameraController.Instance.transform.position + new Vector3(0, 5, 0); | 
|---|
|  |  |  | //     this.transform.rotation = CameraController.Instance.CameraObject.transform.rotation; | 
|---|
|  |  |  | // } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //private void LateUpdate() | 
|---|
|  |  |  | //{ | 
|---|
|  |  |  | //    if (CameraController.Instance != null && CameraController.Instance.CameraObject != null) | 
|---|
|  |  |  | //    { | 
|---|
|  |  |  | //        this.transform.position = CameraController.Instance.transform.position + new Vector3(0, 5, 0); | 
|---|
|  |  |  | //        this.transform.rotation = CameraController.Instance.CameraObject.transform.rotation; | 
|---|
|  |  |  | //    } | 
|---|
|  |  |  | //} | 
|---|
|  |  |  |  | 
|---|
|  |  |  | IEnumerator Co_BackGroundMusicFadeOutIn(AudioClip _clip, bool _oneShot) | 
|---|
|  |  |  | { | 
|---|