コード例 #1
0
ファイル: Station.cs プロジェクト: LogXose/MealOrder
    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;
            }
        }
    }
コード例 #2
0
ファイル: Station.cs プロジェクト: LogXose/MealOrder
    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;
            }
        }
    }
コード例 #3
0
ファイル: StationSlot.cs プロジェクト: LogXose/MealOrder
 public void Transfer()
 {
     Station.Transfer();
     ImageCreator.updateStationCapacityText();
     closeAdjuster();
 }