// Use this for initialization void Start() { panelScript = panelRef.gameObject.GetComponent <GameItemPurchaseManager>(); if (panelScript == null) { panelRef.gameObject.GetComponent <GameItemPurchaseManager>(); } thisButton.onClick.AddListener(OnClickCall); }
private void OnClickDetails() { thisPanel.SetActive(false); GameItemPurchaseManager purchaseScript = purchasePanel.gameObject.GetComponent <GameItemPurchaseManager>(); purchaseScript.purchasedItem = refItem; purchaseScript.returnPanel = thisPanel; purchasePanel.SetActive(true); //Once inventory is implemented, find a way to pass the button's stored object to the details panel }