38 lines
883 B
C#
38 lines
883 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace Inventory {
|
|
|
|
public class EquipmentPanel : MonoBehaviour
|
|
{
|
|
|
|
/// An item that panel stores
|
|
|
|
public Item equipedItem;
|
|
private Item lastItem;
|
|
|
|
[HideInInspector]
|
|
public GridSlot mainSlot;
|
|
|
|
[HideInInspector]
|
|
public int width, height;
|
|
public string allowedItemType;
|
|
|
|
[Header("Using ids ignore allowedItemType. Only specified id items will be equiped")]
|
|
public int[] allowedIds;
|
|
|
|
private void Update()
|
|
{
|
|
if(equipedItem != null && lastItem == null)
|
|
{
|
|
lastItem = equipedItem;
|
|
}
|
|
|
|
if(equipedItem == null && lastItem != null)
|
|
{
|
|
lastItem = null;
|
|
}
|
|
}
|
|
}
|
|
} |