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); var data=JsonTab.Instance.tables.Item.Get(GameSystem.ins.drawingManager.itemsSlot[index]); icon.sprite = AssetBundleManager.ins.Sprite(data.Icon,AtlasType.ItemIcon); } else { icon.gameObject.SetActive(false); } } }