public void TakeInfo(Item TheItem, int ThePlaceInInventroy, ItemHome TheHome)//When the item is created, it takes these paramets to determine its function and to determine where it is placed (inventory or shop, etc) { MyItem = TheItem; MyImage = transform.Find("ItemSpriteIcon").GetComponent <Image>(); CounterText = transform.Find("ItemCounter").GetComponent <Text>(); CounterText.text = ""; MyPlaceInHome = ThePlaceInInventroy; MyHome = TheHome; MyImage.sprite = TheItem.itemIcon; }
/// <summary> /// When the item is created, it takes these paramets to determine its function and to determine where it is placed (inventory or shop, etc) /// </summary> /// <param name="TheItem"></param> /// <param name="ThePlaceInInventroy"></param> /// <param name="TheHome"></param> public void TakeInfo(Item TheItem, int ThePlaceInInventroy, ItemHome TheHome) { MyItem = TheItem; MyImage = transform.Find("ItemSpriteIcon").GetComponent <Image>(); CounterText = transform.Find("ItemCounter").GetComponent <Text>(); CounterText.text = ""; MyPlaceInHome = ThePlaceInInventroy; MyHome = TheHome; MyImage.sprite = TheItem.itemIcon; }