feat: 测试存档功能
This commit is contained in:
@@ -11,7 +11,13 @@ namespace AibisDream.UI
|
||||
[SerializeField] private TMP_Text label;
|
||||
[SerializeField] private Image background;
|
||||
|
||||
public void Bind(string text, Action clicked, bool interactable, Color color, bool isError = false)
|
||||
public void Bind(
|
||||
string text,
|
||||
Action clicked,
|
||||
bool interactable,
|
||||
Color color,
|
||||
bool isError = false,
|
||||
bool isSelected = false)
|
||||
{
|
||||
label.text = text ?? string.Empty;
|
||||
label.color = color;
|
||||
@@ -24,9 +30,11 @@ namespace AibisDream.UI
|
||||
button.interactable = interactable;
|
||||
if (background != null)
|
||||
{
|
||||
background.color = isError
|
||||
? new Color(0.20f, 0.07f, 0.07f, 0.92f)
|
||||
: new Color(0.08f, 0.12f, 0.16f, 0.92f);
|
||||
background.color = isSelected
|
||||
? new Color(0.06f, 0.28f, 0.34f, 0.96f)
|
||||
: isError
|
||||
? new Color(0.20f, 0.07f, 0.07f, 0.92f)
|
||||
: new Color(0.08f, 0.12f, 0.16f, 0.92f);
|
||||
}
|
||||
|
||||
gameObject.SetActive(true);
|
||||
|
||||
Reference in New Issue
Block a user