Advertisement
dronkowitz

Item.cs

Nov 4th, 2022
612
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.90 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. [CreateAssetMenu(fileName = "Item")]
  6. public class Item : ScriptableObject
  7. {
  8.     public string itemID;
  9.     public int value;
  10.     public string description;
  11.     public bool questItem;
  12.     public Sprite itemImage;
  13.     public rarity itemRarity;
  14.     public Color itemColor
  15.     {
  16.         get
  17.         {
  18.             switch (itemRarity)
  19.             {
  20.                 case rarity.common: return Color.white;
  21.                 case rarity.uncommon: return Color.blue;
  22.                 case rarity.masterwork: return Color.green;
  23.                 case rarity.rare: return Color.yellow;
  24.                 case rarity.legendary: return new Color(1, .84f, 0);
  25.                     default: return Color.black;
  26.             }
  27.         }
  28.     }
  29. }
  30. public enum rarity
  31. {
  32.     common,
  33.     uncommon,
  34.     masterwork,
  35.     rare,
  36.     legendary
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement