34 lines
1.2 KiB
C#
34 lines
1.2 KiB
C#
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
public class AddEquipment : MonoBehaviour
|
||
|
{
|
||
|
public void AddOrRemove()
|
||
|
{
|
||
|
if (Inventory.main.EquipedOrNot(Inventory.main.lastCardNum))
|
||
|
{
|
||
|
Inventory.main.playerEquipment.Remove(Inventory.main.allEquipment[Inventory.main.lastCardNum]);
|
||
|
for (int i = 0; i < Inventory.main.playerPlace.Count; i++)
|
||
|
{
|
||
|
if (Inventory.main.playerPlace[i].name == Inventory.main.allEquipment[Inventory.main.lastCardNum].GetComponent<Equipment>().equipmentConfig.equipmentCharacteristics.place.ToString())
|
||
|
{
|
||
|
Inventory.main.playerPlace[i].image.sprite = Inventory.main.imagePlug;
|
||
|
Inventory.main.playerPlace[i].GetComponent<PlaceEquipment>().equipmentNum = -1;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
Inventory.main.playerEquipment.Add(Inventory.main.allEquipment[Inventory.main.lastCardNum]);
|
||
|
Inventory.main.WhichPlace(Inventory.main.lastCardNum);
|
||
|
}
|
||
|
|
||
|
DataScript.PlayerEquipment = Inventory.main.playerEquipment;
|
||
|
|
||
|
EquipmentInfo.main.CardAbout(Inventory.main.lastCardNum);
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|