优化道具稀有度的 UI 表现

This commit is contained in:
2026-10-04 15:45:54 +08:00
parent c76a421f4a
commit 75ec52f3d4
24 changed files with 1690 additions and 818 deletions
@@ -0,0 +1,37 @@
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.")
};
}
}
}