public void showTooltip(Vector3 toolPosition, med_data datab) { toolTip.SetActive (true); toolTip.GetComponent<RectTransform> ().localPosition = new Vector3 (toolPosition.x, toolPosition.y + 50, toolPosition.z); toolTip.transform.GetChild (0).GetComponent<Text> ().text = datab.medName; //toolTip.transform.GetChild (1).GetComponent<Text> ().text = datab.medType; toolTip.transform.GetChild (2).GetComponent<Text> ().text = datab.medDesc; }
//drag public void showDraggedItem(med_data datab, int slotnumber) { slotIndex = slotnumber; closeTooltip (); draggedItem.SetActive (true); thedragItem = datab; draggingItem = true; draggedItem.GetComponent<Image>().sprite = datab.medIcon; }
void addMedEmtptySlot(med_data datas) { for (int i = 0; i < datab.Count; i++) { if (datab[i].medName == null) { datab[i] = datas; break; } } }
// Update is called once per frame void Update() { if(inventory.datab[slotNum].medName != null) { datab = inventory.datab[slotNum]; medImage.enabled = true; medImage.sprite = inventory.datab[slotNum].medIcon; if(inventory.datab[slotNum].medType == med_data.MedType.Tablet) //Tablet { medAmount.enabled = true; medAmount.text = ""+inventory.datab[slotNum].medValue; } if(inventory.datab[slotNum].medType == med_data.MedType.Capsule) //Capsule { medAmount.enabled = true; medAmount.text = ""+inventory.datab[slotNum].medValue; } if(inventory.datab[slotNum].medType == med_data.MedType.Liquid) //Liquid { medAmount.enabled = true; medAmount.text = ""+inventory.datab[slotNum].medValue; } if(inventory.datab[slotNum].medType == med_data.MedType.TopicalMedicine) //Topical Medicine { medAmount.enabled = true; medAmount.text = ""+inventory.datab[slotNum].medValue; } if(inventory.datab[slotNum].medType == med_data.MedType.Implant) //Implant { medAmount.enabled = true; medAmount.text = ""+inventory.datab[slotNum].medValue; } if(inventory.datab[slotNum].medType == med_data.MedType.Drops) //Drops { medAmount.enabled = true; medAmount.text = ""+inventory.datab[slotNum].medValue; } } else { medImage.enabled = false; } }