private void Awake() { crossair = UI_Camera.transform.GetComponentInChildren <Image>(); interactUI = SteamVR_Actions._default.InteractUI; cart = gameObject.transform.Find("Canvas/AddToCartBtn/AddToCart").GetComponent <cartHandler>(); WS = GameObject.Find("Store").GetComponent <websockets>(); }
protected override void Awake() { base.Awake(); WS = GameObject.Find("Store").GetComponent <websockets>(); articleUI = GameObject.Find("ArticleUI").GetComponent <ArticleUI>(); cart = GameObject.Find("ArticleUI/Canvas/AddToCartBtn/AddToCart").GetComponent <cartHandler>(); buyHandler = GameObject.Find("Store/Checkout/CheckoutCanvas/Buy").GetComponent <BuyHandler>(); dot = m_Camera.GetComponentInChildren <Image>(); m_Data = new PointerEventData(eventSystem); }
private void ProcessPress(PointerEventData data) { string buy = ""; if (m_CurrentGameObject != null) { buy = m_CurrentGameObject.name; } if (buy == "Buy" && WS.qtInCart > 0) { buyHandler.buyAll(); } else if (articleUI.isActiveAndOpened()) { cartHandler cH = m_CurrentGameObject.GetComponent <cartHandler>(); if (cH != null) { cH.addToCart(); } } }