0% found this document useful (0 votes)
5 views

Wardrobe Cs

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Wardrobe Cs

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

using System.

Collections;
using System.Collections.Generic;
using UnityEngine;
using PlayFab;
using System.Reflection.Emit;
using PlayFab.ClientModels;
using TMPro;
using UnityEngine.SceneManagement;
using Unity.VisualScripting;

public class wardrobe : MonoBehaviour


{
[Header("Made by Ultra, wardrobe!")]
[Header("No credits needed!")]
[Header("COSMETICS")]
public static Playfablogin instance;
public string MyPlayFabID;
public string CosmeticsCatalogName;
public List<GameObject> CosmeticsPrefab;
private List<GameObject> CosmeticsPrefabHave;
public int cosmeticscount;
public int pagecount;
public Vector3 firstpos;
public Vector3 secondpos;
public Vector3 thirdpos;
public int currentpage;

private void Start()


{
currentpage = 0;
}
private void Update()
{
cosmeticscount = CosmeticsPrefabHave.Count + 1;
pagecount = Mathf.RoundToInt(cosmeticscount/3) + 1;
Debug.LogError(pagecount);
foreach (var cos in CosmeticsPrefabHave)
{
int index = CosmeticsPrefabHave.IndexOf(cos) + 1;
if (currentpage == index / 1)
{
Instantiate(cos, firstpos, Quaternion.identity);
}

if (currentpage == index / 2)
{
Instantiate(cos, secondpos, Quaternion.identity);
}

if (currentpage == index / 3)
{
Instantiate(cos, thirdpos, Quaternion.identity);
}

if (currentpage != index / 1 && currentpage != index / 2 && currentpage


!= index / 3)
{
Destroy(cos);
}

}
}
public void AccountInfoSuccess(GetAccountInfoResult result)
{
MyPlayFabID = result.AccountInfo.PlayFabId;

PlayFabClientAPI.GetUserInventory(new GetUserInventoryRequest(),
(result) =>
{
foreach (var item in result.Inventory)
{
if (item.CatalogVersion == CosmeticsCatalogName)
{
for (int i = 0; i < CosmeticsPrefab.Count; i++)
{
if (CosmeticsPrefab[i].name == item.ItemId)
{
CosmeticsPrefabHave.Add(CosmeticsPrefab[i]);
}
}
}
}
},
(error) =>
{
Debug.LogError(error.GenerateErrorReport());
});

}
}

You might also like