using UnityEngine;
|
using UnityEngine.UI;
|
|
public class PhantasmPavilionPutOnButton : MonoBehaviour
|
{
|
[SerializeField] ButtonEx btnPutOn;
|
[SerializeField] ImageEx imgPutOn;
|
[SerializeField] TextEx txtPutOn;
|
[SerializeField] Image imgRed;
|
PhantasmPavilionType type;
|
int id;
|
PhantasmPavilionManager manager { get { return PhantasmPavilionManager.Instance; } }
|
public void Display(int id)
|
{
|
type = manager.nowType;
|
this.id = id;
|
btnPutOn.SetListener(() =>
|
{
|
manager.SendOPPack(type, PhantasmPavilionOperation.Wear, (uint)id);
|
});
|
|
bool isUsing = manager.IsUsing(type, id);
|
if (type == PhantasmPavilionType.Title)
|
{
|
txtPutOn.text = Language.Get("EquipExchangeWin9");
|
btnPutOn.interactable = true;
|
imgPutOn.gray = false;
|
}
|
else
|
{
|
|
txtPutOn.text = Language.Get(isUsing ? "PhantasmPavilion09" : "EquipExchangeWin9");
|
imgPutOn.gray = isUsing;
|
btnPutOn.interactable = !isUsing;
|
}
|
|
}
|
|
}
|