private void InitFromScriptableObject() { //read stats from SO ItemName = scriptableObject_Item.itemName; ItemRarity = scriptableObject_Item.itemRarity; //instantiate item model. rotation matches that of parent this.itemModel = Instantiate(scriptableObject_Item.itemModel, itemModelHolder.transform.position, itemModelHolder.transform.rotation, itemModelHolder.transform); }
public static readonly Color mythic = new Color(1.0f, 0.2f, 0.2f, 1.0f); //red public static Color GetRarityColor(ItemRarityENUM rarity) { Color rarityColor; switch (rarity) { case ItemRarityENUM.Common: rarityColor = common; break; case ItemRarityENUM.Uncommon: rarityColor = uncommon; break; case ItemRarityENUM.Rare: rarityColor = rare; break; case ItemRarityENUM.Epic: rarityColor = epic; break; case ItemRarityENUM.Legendary: rarityColor = legendary; break; case ItemRarityENUM.Mythic: rarityColor = mythic; break; default: Debug.Log("What am I doing with my life?"); rarityColor = Color.white; break; } return(rarityColor); }