42 lines
893 B
C#
42 lines
893 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class DrawingSlot : 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()
|
|
{
|
|
FreePanel.ins.SaveIndex(index);
|
|
}
|
|
|
|
public void ResetIcon(FreePanel panel)
|
|
{
|
|
if (panel.itemsSlot[index]!=0)
|
|
{
|
|
icon.gameObject.SetActive(true);
|
|
var data=JsonTab.Instance.tables.Item.Get(FreePanel.ins.itemsSlot[index]);
|
|
icon.sprite = AssetBundleManager.ins.Sprite(data.Icon,AtlasType.ItemIcon);
|
|
}
|
|
else
|
|
{
|
|
icon.gameObject.SetActive(false);
|
|
}
|
|
}
|
|
}
|