void Start() { //MyStore = GameObject.Find ("Store"); MyInv = GameObject.Find("Inventory"); Tooltip = GameObject.Find("Store").GetComponent <StoreToolTip>(); MyInvScript = MyInv.GetComponent <inventoryInStore> (); Myitem_Database = GameObject.Find("Store").GetComponent <Item_Database>(); }
public void OnInvButtonClicked() { inTheMain = false; MyStoreInvScript = inventory.GetComponent <inventoryInStore> (); if (MyStoreInvScript == null) { inTheMain = true; MyMainInvScript = inventory.GetComponent <Inventory> (); } if (!inventoryPanel.activeSelf) { inventoryPanel.SetActive(true); SkillTouch1.GetComponent <Image>().raycastTarget = false; SkillTouch2.GetComponent <Image>().raycastTarget = false; SkillTouch3.GetComponent <Image>().raycastTarget = false; } else { inventoryPanel.SetActive(false); SkillTouch1.GetComponent <Image>().raycastTarget = true; SkillTouch2.GetComponent <Image>().raycastTarget = true; SkillTouch3.GetComponent <Image>().raycastTarget = true; if (inTheMain) { MyMainInvScript.save(); } else { MyStoreInvScript.save(); } } }
void Start() { MyInv = GameObject.Find("Inventory"); //SlotPanel = transform.parent.parent.parent.gameObject; MyInvScript = MyInv.GetComponent <inventoryInStore> (); }