public void TransactionIE(GameObject current, GameObject sended, int quantaty) { Station station = current.GetComponent <Station>(); for (int i = 0; i < 8; i++) { if (current.GetComponent <Station>().inventory[i].typeOfItem == sended && station.capacityCur + quantaty < station.capacity) { current.GetComponent <Station>().inventory[i].count += quantaty; station.capacityCur += quantaty; ImageCreator.updateStationCapacityText(); return; } } for (int i = 0; i < 8; i++) { if (current.GetComponent <Station>().inventory[i].typeOfItem == null && station.capacityCur + quantaty < station.capacity) { current.GetComponent <Station>().inventory[i].typeOfItem = sended; current.GetComponent <Station>().inventory[i].count += quantaty; station.capacityCur += quantaty; ImageCreator.updateStationCapacityText(); return; } } }
public static void BackTransaction(GameObject item, int quantaty) { GameObject current = PlayerController.current; for (int i = 0; i < 8; i++) { if (current.GetComponent <Station>().inventory[i].typeOfItem == item) { current.GetComponent <Station>().inventory[i].count -= quantaty; ImageCreator.updateStationCapacityText(); return; } } }
public void Transfer() { Station.Transfer(); ImageCreator.updateStationCapacityText(); closeAdjuster(); }