自動調理破棄時に個数を赤色にする対応
This commit is contained in:
parent
530bad4a4f
commit
240c078973
|
|
@ -8,12 +8,21 @@ namespace MyGame.Scenes.Main.Scripts
|
|||
{
|
||||
[SerializeField] private Transform target;
|
||||
[SerializeField] private Text amountText;
|
||||
|
||||
public void SetView(ProductData data)
|
||||
private Color redColor;
|
||||
private void Awake()
|
||||
{
|
||||
ColorUtility.TryParseHtmlString(Const.RedColorString, out redColor);
|
||||
}
|
||||
|
||||
public void SetView(ProductData data, bool red = false)
|
||||
{
|
||||
target.DestroyAllChildrens();
|
||||
Instantiate(data.GetIconPrefab(), target);
|
||||
amountText.text = $"×{data.volume}";
|
||||
if (red)
|
||||
{
|
||||
amountText.color = redColor;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetActive(bool active)
|
||||
|
|
|
|||
Loading…
Reference in New Issue