Advertisement
LittleAngel

Untitled

Mar 16th, 2011
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. void OnGUI () {
  2. // code
  3.  
  4. for (int i = 0; i < contentList.Count; i ++) {
  5. if (contentList[i] != null) {
  6. // currentToolTip = "ToolTip";
  7. Debug.Log ("contentList[i]: " + contentList[i]);
  8. Debug.Log ("contentList[i].itemName: " + contentList[i].itemName);
  9. SetToolTip (contentList[i]);
  10. if (GUI.Button (new Rect (0, startY, 120, 30),
  11. new GUIContent (contentList[i].itemName, contentList[i].itemIcon, currentToolTip))) {
  12. AddItem(contentList[i]);
  13. contentList[i] = null;
  14. currentLootableItem.UpdateLootList(contentList);
  15. }
  16. startY = startY + 35;
  17. }
  18. }
  19.  
  20. // code
  21. }
  22.  
  23. void SetToolTip (InventoryItem thisItem) {
  24. currentToolTip = thisItem.itemName + " " + thisItem.healthBonus + "/" + thisItem.strengthBonus + "/" + thisItem.armorBonus;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement