private void Awake() { if (cartContent != null) { handler = cartContent.GetComponent <CartGridUI>(); } }
private void Awake() { if (cartContent != null) { handler = cartContent.GetComponent <CartGridUI>(); } // allItemInfoUI = GameObject.FindObjectOfType<AllItemInfoUI>(); }
public void Increase() { CartGridUI gridHandler = transform.parent.GetComponent <CartGridUI>(); count++; inputCount.text = System.Convert.ToString(count); textCost.text = "$" + cost.ToString(); gridHandler.Increase(itemName); }
public void Decrease() { count--; if (count == 0) { if (transform.parent == null) { return; } CartGridUI gridHandler = transform.parent.GetComponent <CartGridUI>(); if (gridHandler != null) { gridHandler.RemoveFromCart(itemName); } } else { inputCount.text = System.Convert.ToString(count); textCost.text = "$5"; } }