using System;
using System.Linq;
using UnityEngine;

namespace Game
{
	[CreateAssetMenu(menuName = "Managers/Color Manager")]
	public class ColorManager : ScriptableObject
	{
		[Serializable]
		public class ColorItem
		{
			public ColorType colorType;
			public Color color;
		}

		[SerializeField] private ColorItem[] colors;

		public Color GetColor(ColorType colorType)
		{
			var color = colors.FirstOrDefault(c => c.colorType == colorType);
			return color != null ? color.color : Color.clear;
		}
	}
}