57 lines
1012 B
C#
57 lines
1012 B
C#
|
using System;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using TMPro;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.EventSystems;
|
||
|
using UnityEngine.UI;
|
||
|
|
||
|
public class ItemButton : MonoBehaviour
|
||
|
{
|
||
|
[SerializeField] private int id;
|
||
|
[SerializeField] private Image _image;
|
||
|
[SerializeField] private TextMeshProUGUI numPro;
|
||
|
|
||
|
private void Awake()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
// Start is called before the first frame update
|
||
|
void Start()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
private void OnEnable()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
// Update is called once per frame
|
||
|
void Update()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
private void OnDisable()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
public void SendID()
|
||
|
{
|
||
|
GameSystem.ins.SaveSeledID(id);
|
||
|
}
|
||
|
|
||
|
public void SetItemData(int dataID)
|
||
|
{
|
||
|
id = dataID;
|
||
|
_image.sprite = GameSystem.ins.DataAsset.IconSprite(id);
|
||
|
numPro.text = (DataManager.item(id).num-GameSystem.ins.drawingManager.slotNum(id)).ToString();
|
||
|
}
|
||
|
|
||
|
private void OnMouseDown()
|
||
|
{
|
||
|
|
||
|
}
|
||
|
}
|