using System;
using Intrepid.Utilities;
using UnityEngine;

namespace Intrepid.Gameplay.Themes
{
    [DefaultExecutionOrder(GonConstants.ExecutionOrder.ASAP)]
    public class ThemeManager : SingletonMonoBehaviour<ThemeManager>
    {
        [GroupConfigurations, SerializeField] private Theme defaultTheme;
        [GroupDebug, SerializeField] private Theme currentTheme;

        public Theme CurrentTheme
        {
            get => currentTheme.IsNotNull() ? currentTheme : defaultTheme;
            set => currentTheme = value;
        }

        private void Awake()
        {
            SingletonInstantiation(false, _ => { });
        }
    }
}