69 lines
1.7 KiB
C#
69 lines
1.7 KiB
C#
using UnityEngine;
|
|
|
|
namespace VRShopping.Items
|
|
{
|
|
[CreateAssetMenu(fileName = "ItemData", menuName = "VR Shopping/Item Data", order = 0)]
|
|
public class ItemData : ScriptableObject
|
|
{
|
|
[Header("Identity")]
|
|
[SerializeField] private string _itemId;
|
|
[SerializeField] private string _displayName;
|
|
[SerializeField] private string _brand;
|
|
[SerializeField] private ItemCategory _category;
|
|
[SerializeField] private ProductGroup _productGroup;
|
|
|
|
[Header("Pricing")]
|
|
[SerializeField, Min(0)] private int _basePrice;
|
|
[SerializeField, Range(0f, 1f)] private float _discountRate;
|
|
|
|
[Header("Visuals")]
|
|
//[SerializeField] private Sprite _icon;
|
|
[SerializeField] private GameObject _prefab;
|
|
|
|
public string ItemId => _itemId;
|
|
public string DisplayName => _displayName;
|
|
public string Brand => _brand;
|
|
public ItemCategory Category => _category;
|
|
public ProductGroup ProductGroup => _productGroup;
|
|
public int BasePrice => _basePrice;
|
|
public float DiscountRate => _discountRate;
|
|
//public Sprite Icon => _icon;
|
|
public GameObject Prefab => _prefab;
|
|
|
|
public int FinalPrice => Mathf.RoundToInt(_basePrice * (1f - _discountRate));
|
|
}
|
|
|
|
public enum ItemCategory
|
|
{
|
|
Etc,
|
|
Fruit,
|
|
Vegetable,
|
|
Grain,
|
|
Noodles,
|
|
Dairy,
|
|
Bakery,
|
|
Meat,
|
|
Drink,
|
|
Snack,
|
|
Household,
|
|
Tea
|
|
|
|
}
|
|
|
|
public enum ProductGroup
|
|
{
|
|
None,
|
|
ChocoBar,
|
|
PotatoChip,
|
|
GreenBeans,
|
|
CheeseChip,
|
|
Rice,
|
|
Pasta,
|
|
Butter,
|
|
Cheese,
|
|
Milk,
|
|
Diaper,
|
|
GrainMixTea,
|
|
}
|
|
}
|