38 lines
1.0 KiB
C#
38 lines
1.0 KiB
C#
using System;
|
|
using SepCore.Definition;
|
|
using UnityEngine;
|
|
|
|
namespace SepCore.UI
|
|
{
|
|
[CreateAssetMenu(menuName = "UI/Rarity Palette")]
|
|
public class RarityPalette : ScriptableObject
|
|
{
|
|
[Serializable]
|
|
public struct Colors
|
|
{
|
|
public Color Border;
|
|
public Color CardBackground;
|
|
public Color IconBackground;
|
|
}
|
|
|
|
[SerializeField] private Colors _none;
|
|
[SerializeField] private Colors _white;
|
|
[SerializeField] private Colors _blue;
|
|
[SerializeField] private Colors _purple;
|
|
[SerializeField] private Colors _red;
|
|
|
|
public Colors Get(Rarity rarity)
|
|
{
|
|
return rarity switch
|
|
{
|
|
Rarity.None => _none,
|
|
Rarity.White => _white,
|
|
Rarity.Blue => _blue,
|
|
Rarity.Purple => _purple,
|
|
Rarity.Red => _red,
|
|
_ => throw new ArgumentOutOfRangeException(nameof(rarity), rarity, "Unsupported UI rarity.")
|
|
};
|
|
}
|
|
}
|
|
}
|