I want to get data from result and Total Row , but result cant defined it. But when I use api without array Result and TotalRow. I can use it with allProduct[i].name_category and direct to JsonClassPro. But now i want to use with array for make one API. Can anyone help ?
void DrawUI()
{
for (int i = 0; i < 10; i++)
{
GameObject goItems = (GameObject)Instantiate(prefabItems);
goItems.transform.SetParent(ParentItems, false);
goItems.transform.GetChild(1).GetComponent <TMPro.TMP_Text>().text = allProduct.Result[i].name_category;
goItems.transform.GetChild(2).GetComponent <TMPro.TMP_Text>().text = allProduct.Result[i].name;
goItems.transform.GetChild(3).GetComponent <TMPro.TMP_Text>().text = allProduct.Result[i].price.ToString();
PlayerPrefs.SetString("IdProduct",allProduct[i].id_product);
goItems.GetComponent<Button> ().AddEventListener(i, ItemClicked);
}
}
API