Ejemplo n.º 1
0
    public void SetItemBundle(int bundleIndex, Item item)
    {
        // 잘못된 범위 입력시 중단
        if (bundleIndex < 0 || bundleIndex >= bundle.Count)
        {
            Debug.LogError("오류 :: 잘못된 메소드 사용 -> Out of range");
            Debug.Break();
            return;
        }

        // 대상 지정
        ItemShopBundle target = bundle[bundleIndex];

        // 선택 초기화
        target.toggle.enabled = true;
        target.toggle.isOn    = false;

        // 아이템 설정
        target.item = item;

        // 수량 설정
        target.slot.count = 1;

        // 새로고침
        target.Refresh();
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 아이템 상품에 대한 지불 및 구매
    /// </summary>
    /// <param name="customer">구매자</param>
    /// <param name="ib">상품</param>
    void Pay(Player customer, ItemShopBundle ib)
    {
        // 비용 지불
        customer.coin.subtract(ib.priceValue);

        // 아이템 지급
        customer.AddItem(ib.slot, 1);
    }