41 lines
835 B
C#
41 lines
835 B
C#
|
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);
|
||
|
}
|
||
|
}
|
||
|
}
|