thewar_client/Client/Assets/1_Script/ShopMenuItem.cs

44 lines
944 B
C#

using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
public class ShopMenuItem : MonoBehaviour
{
[SerializeField] RectTransform image;
[SerializeField] TMP_Text text;
ShopData shopData;
bool isSelect = false;
public void Set(ShopData shopData)
{
this.shopData = shopData;
text.text = shopData.name;
}
public void SelectButton()
{
isSelect = true;
ShopUiCtrl.Instance.SelectShopMenu();
}
public void ChangeButton()
{
if (isSelect)
{
image.offsetMin = new Vector2(-15.0f, -5.0f);
image.offsetMax = new Vector2(0.0f, 5.0f);
text.fontSize = 43.2f;
}
else
{
image.offsetMin = new Vector2 (0.0f, 0.0f);
image.offsetMax = new Vector2(0.0f, 0.0f);
text.fontSize = 36.0f;
}
isSelect = false;
}
}