IEnumerator waitandaddrequest(Collider other) { Vuforia.RetailItemScript productinfo = other.gameObject.transform.parent.GetComponent <Vuforia.RetailItemScript>(); yield return(new WaitForSeconds(1)); addDataToBar(productinfo.GetProductName(), productinfo.GetSales()); }
void OnTriggerEnter(Collider other) { if (ShowBarChart == false) { ShowBarChart = true; myBarchart.SetActive(true); } Vuforia.RetailItemScript productinfo = other.gameObject.transform.parent.GetComponent <Vuforia.RetailItemScript>(); if (productinfo.GetProductName() == "") { productinfo.filtProd(); waitandaddrequest(other); } else { addDataToBar(productinfo.GetProductName(), productinfo.GetSales()); } }
void OnTriggerExit(Collider other) { AddBarData myBarScript = myBarchart.GetComponent <AddBarData>(); Vuforia.RetailItemScript productinfo = other.gameObject.transform.parent.GetComponent <Vuforia.RetailItemScript>(); myBarScript.RemoveCategory(productinfo.GetProductName()); if (myBarScript.getAmountOfCategories() == 0) { ShowBarChart = false; myBarchart.SetActive(false); } Debug.Log("SUCCESS Removed"); }