Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.31 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5.  
  6. public class PlayerEquippedItemStats : MonoBehaviour
  7. {
  8.     public Image helmetRarity;
  9.     public Text helmetInfo;
  10.  
  11.     public Image swordRarity;
  12.     public Text swordInfo;
  13.  
  14.     public Image bootsRarity;
  15.     public Text bootsInfo;
  16.  
  17.     public PlayerStats playerStats;
  18.     public ItemDrop itemDrop;
  19.     private ItemManager itemManager;
  20.  
  21.     ItemQuality quality;
  22.     // Use this for initialization
  23.     void Start ()
  24.     {
  25.         playerStats = PlayerStats.instance;
  26.         itemDrop = ItemDrop.instance;
  27.         itemManager = ItemManager.instance;
  28.         HelmetInfo();
  29.         SwordInfo();
  30.         BootsInfo();
  31.     }
  32.  
  33.     // Update is called once per frame
  34.     void Update ()
  35.     {
  36.        
  37.     }
  38.  
  39.     public void HelmetInfo()
  40.     {
  41.         helmetInfo.text = GetEquippedItemInfo(ItemType.Helmet);
  42.     }
  43.  
  44.     public void SwordInfo()
  45.     {
  46.         swordInfo.text = GetEquippedItemInfo(ItemType.Sword);
  47.     }
  48.  
  49.     public void BootsInfo()
  50.     {
  51.         bootsInfo.text = GetEquippedItemInfo(ItemType.Boots);
  52.     }
  53.  
  54.  
  55.     private string GetEquippedItemInfo(ItemType itemType)
  56.     {
  57.         return itemDrop.ConstructStatBlock(out quality, playerStats.equippedItems[(int)itemType]);
  58.     }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement