mirror of
https://github.com/tym1116/BH3.git
synced 2025-12-12 22:44:35 +01:00
37 lines
904 B
C#
37 lines
904 B
C#
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace MoleMole
|
|
{
|
|
[RequireComponent(typeof(Button))]
|
|
public class MonoItempediaSortButton : MonoBehaviour
|
|
{
|
|
private Action Clicked;
|
|
|
|
public void SetClickCallback(Action cb)
|
|
{
|
|
Clicked = cb;
|
|
}
|
|
|
|
public void OnClick()
|
|
{
|
|
if (Clicked != null)
|
|
{
|
|
Clicked();
|
|
}
|
|
}
|
|
|
|
public void SetupView(bool selected, bool asent)
|
|
{
|
|
Image component = base.transform.GetComponent<Image>();
|
|
bool flag = (component.enabled = selected);
|
|
component.color = ((!flag) ? Color.white : MiscData.GetColor("Yellow"));
|
|
base.transform.Find("Text").GetComponent<Text>().color = ((!flag) ? Color.white : MiscData.GetColor("Black"));
|
|
base.transform.Find("Order").gameObject.SetActive(flag);
|
|
base.transform.Find("Order/UpImg").gameObject.SetActive(asent);
|
|
base.transform.Find("Order/DownImg").gameObject.SetActive(!asent);
|
|
}
|
|
}
|
|
}
|