//NEW================================================================= // Use this for initialization void Start() { //NEW================================================================= //Get a handle to the BRS_Mechanics and the Inventory Manager script _BRS_Mechanics = GameObject.Find("BRS_Mechanics"); _IM = _BRS_Mechanics.GetComponent <BRS_InventoryManager>(); //Get a handle to the ItemHolder object var IHTrans = this.gameObject.transform.GetChild(1); ItemHolder = IHTrans.gameObject; //Get the ItemHolder's Animator anim = gameObject.GetComponent <Animator>(); //NEW================================================================= //Get all of the Text Mesh Pros TMPTexts = ItemParameters.LootPickUp.GetComponentsInChildren <TextMeshProUGUI>(); //TMPTexts = gameObject.GetComponentsInChildren<TextMeshProUGUI> (); //Go through all the Texts and based upon what it is, set values for (int i = 0; i < TMPTexts.Length; i++) { switch (TMPTexts[i].name) { case "_PickUpBtnText": TMPTexts[i].text = ItemParameters.PickUpButtonText; //PickUpButton = TMPTexts [i]; //PickUpButton.text = PickUpButtonText; //NEW================================================================= //Convert our PickUp button text to lowercase //PickUpButtonText = PickUpButtonText.ToLower(); break; case "_txtType": TMPTexts[i].text = ItemParameters.ItemType; break; case "_txtItemName": TMPTexts[i].text = ItemParameters.ItemName; break; case "_txtRarity": TMPTexts[i].text = ItemParameters.ItemRarity.ToString(); break; case "_txtAmount": PickUpButton = TMPTexts[i]; //PickUpButton.text = ItemAmmount; break; } } //Based upon what Rarity we choose, set the background color switch (ItemParameters.ItemRarity.ToString()) //switch (TMP_ItemRarity.text) { case "Common": //ItemBackground.color = Common; break; case "Uncommon": //ItemBackground.color = Uncommon; break; case "Rare": //ItemBackground.color = Rare; break; case "Epic": //ItemBackground.color = Epic; break; case "Legendary": //ItemBackground.color = Legendary; break; case "Mythic": //ItemBackground.color = Mythic; break; } //Make the widget "invisible" (deactivate) for now ToolTipWidget.SetActive(false); }
void Start() { _IM = GameObject.Find("BRS_Mechanics").GetComponent <BRS_InventoryManager>(); UISlots = GameObject.FindGameObjectsWithTag(STATIC_TAG); }