48 lines
873 B
C#
48 lines
873 B
C#
using System.Linq;
|
|
using System.Reflection;
|
|
using log4net;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace Managers
|
|
{
|
|
public class AVEffectsManager : MonoBehaviour
|
|
{
|
|
private static ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
|
|
|
public static AVEffectsManager G { get; private set; }
|
|
|
|
[HideInInspector]
|
|
public AudioLibrary audioLibrary;
|
|
|
|
private AudioSource centralAudioSource;
|
|
|
|
// Start is called before the first frame update
|
|
void Awake()
|
|
{
|
|
G = this;
|
|
Log.Info("Awake");
|
|
if (gameObject.TryGetComponent(out AudioLibrary al))
|
|
{
|
|
audioLibrary = al;
|
|
}
|
|
}
|
|
|
|
void Start()
|
|
{
|
|
if(audioLibrary == null){
|
|
return;
|
|
}
|
|
centralAudioSource = audioLibrary.audios.First(a => a.tag == "music")?.audioSource;
|
|
if(centralAudioSource != null)
|
|
centralAudioSource.Play();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public enum Music
|
|
{
|
|
|
|
} |