41 lines
835 B
C#
Raw Normal View History

2024-11-13 16:56:37 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class SlotUI : MonoBehaviour
{
[SerializeField] private int index;
[SerializeField] private Image icon;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void SaveIndex()
{
GameSystem.ins.SaveIndex(index);
}
public void ResetIcon()
{
if (GameSystem.ins.drawingManager.itemsSlot[index]!=0)
{
icon.gameObject.SetActive(true);
icon.sprite = GameSystem.ins.DataAsset.IconSprite(GameSystem.ins.drawingManager.itemsSlot[index]);
}
else
{
icon.gameObject.SetActive(false);
}
}
}