void Start() { merchantInfoBubble = gameObject.transform.Find("MerchantPopup").gameObject; merchantInfoBubble.SetActive(false); mainCamera = GameObject.FindWithTag("MainCamera"); guiScreenManager = GameObject.Find("Canvas/Screens").gameObject.GetComponent <GuiScreenManager>(); }
void Awake() { if (inventory == null) { var inventoryManager = GameObject.FindWithTag("InventoryManager"); inventory = inventoryManager.GetComponent <PlayerInventory>(); } if (isInventoryPanel) { // Find the DropButton inside the slotpanel only if its inventory panel slot dropItemButton = gameObject.transform.GetChild(1).gameObject; dropItemButton.SetActive(false); } //Debug.Log("object we foudn was: " + dropItemButton); eventTrigger = this.gameObject.GetComponent <EventTrigger>(); playerCharacter = GameObject.FindGameObjectWithTag("MyPlayer"); playerAttack = playerCharacter.GetComponent <Attack>(); playerHealth = playerCharacter.GetComponent <PlayerHealth>(); slotIcon = this.gameObject.GetComponent <Image>(); if (guiScreenManager == null) { guiScreenManager = GameObject.Find("Canvas/Screens").GetComponent <GuiScreenManager>(); } itemToolTip = transform.Find("ToolTipHoverCanvas").GetComponent <ItemToolTip>(); }
public void OnSceneChange() { guiScreenManager = GameObject.Find("Canvas/Screens").gameObject.GetComponent <GuiScreenManager>(); }