示例#1
0
    //購入または着る
    private void BuyorWear()
    {
        if (IsSelect == false)
        {
            if (!connect.IsWait())
            {
                //インベントリ内にアイテムがなければ購入
                if (!inventory.IsHaveItem(selectclothing.GetItemInfo().storeItem.ItemId))
                {
                    playfabstore.BuyItem(selectclothing.GetItemInfo().storeItem.ItemId, PriceName);
                    Debug.Log(selectclothing.GetItemInfo().storeItem.ItemId + "を購入しました");
                }
                //持っていれば着用
                else
                {
                    playerData.SetPlayerData(PlayerDataName.ECLOTHES, selectclothing.GetItemInfo().catalogItem.ItemId);
                    // プレイヤーデータの更新
                    playerData.RequestGetData();
                    Debug.Log(selectclothing.GetItemInfo().catalogItem.ItemId + "を着用しました");

                    // プレイヤーの見た目更新
                    playerAvatar.UpdateAvatar(selectclothing.GetItemInfo().catalogItem.ItemId);

                    // カーテンを開くアニメーション
                    curtainAnime.ChangeOpen();
                }
                playermoney.RequestMoney();
                IsSelect = true;
            }
        }
        else
        {
            if (!connect.IsWait())
            {
                State    = STATE.UPDATE;
                IsSelect = false;
            }
        }
    }