This commit is contained in:
2026-06-02 08:27:03 +07:00
parent 7889064469
commit a48cd962e1
4232 changed files with 2 additions and 36881 deletions

View File

@@ -0,0 +1,42 @@
using System.Collections.Generic;
using UnityEngine;
namespace Invector.vItemManager
{
public class vUnequipItemToArea : MonoBehaviour
{
[HideInInspector]
public List<vEquipArea> equipAreas;
protected vEquipArea equipArea;
protected vInventory inventory;
void Start()
{
equipAreas = GetComponentsInChildren<vEquipArea>().vToList();
foreach (vEquipArea area in equipAreas)
{
area.onSelectEquipArea.AddListener(OnSelectArea);
}
inventory = GetComponentInParent<vInventory>();
}
public void OnSelectArea(vEquipArea area)
{
equipArea = area;
}
protected vEquipSlot currentSlot
{
get { return equipArea ? equipArea.currentSelectedSlot ? equipArea.currentSelectedSlot : equipArea.lastSelectedSlot : null; }
}
public void UnequipItem()
{
if (equipArea && currentSlot != null && currentSlot.item != null)
{
equipArea.RemoveItemOfEquipSlot(currentSlot);
}
}
}
}