102 lines
3.0 KiB
C#
102 lines
3.0 KiB
C#
using System;
|
|
using BlueWater.Interfaces;
|
|
using Newtonsoft.Json;
|
|
using Sirenix.OdinInspector;
|
|
using UnityEngine;
|
|
|
|
namespace BlueWater.Items
|
|
{
|
|
public enum ItemType
|
|
{
|
|
None = 0,
|
|
FoodIngredient,
|
|
Currency,
|
|
Dish,
|
|
Drink,
|
|
Quest = 9
|
|
}
|
|
|
|
public enum IngredientType
|
|
{
|
|
None = 0,
|
|
Meat,
|
|
Fish,
|
|
Egg,
|
|
Fruit,
|
|
Shellfish,
|
|
Seasoning
|
|
}
|
|
|
|
public enum ItemQuality
|
|
{
|
|
None = 0,
|
|
Normal,
|
|
High
|
|
}
|
|
|
|
[Serializable]
|
|
public class ItemData : IPickup
|
|
{
|
|
[BoxGroup("Json 데이터 영역")]
|
|
[field: SerializeField, Tooltip("고유 식별 ID"), BoxGroup("Json 데이터 영역")]
|
|
public string Idx { get; set; }
|
|
|
|
[field: SerializeField, Tooltip("이름"), BoxGroup("Json 데이터 영역")]
|
|
public string Name { get; set; }
|
|
|
|
[field: SerializeField, Tooltip("아이템 종류"), BoxGroup("Json 데이터 영역")]
|
|
public ItemType Type { get; set; }
|
|
|
|
[field: SerializeField, Tooltip("재료 종류"), BoxGroup("Json 데이터 영역")]
|
|
public IngredientType IngredientType { get; set; }
|
|
|
|
[field: SerializeField, Tooltip("아이템 품질"), BoxGroup("Json 데이터 영역")]
|
|
public ItemQuality Quality { get; set; }
|
|
|
|
[field: SerializeField, Tooltip("가격"), BoxGroup("Json 데이터 영역")]
|
|
public int Price { get; set; }
|
|
|
|
[field: SerializeField, Tooltip("무게"), BoxGroup("Json 데이터 영역")]
|
|
public int Weight { get; set; }
|
|
|
|
[field: SerializeField, Tooltip("설명"), TextArea(3, 10), BoxGroup("Json 데이터 영역")]
|
|
public string Description { get; set; }
|
|
|
|
[BoxGroup("직접 추가하는 영역")]
|
|
[field: SerializeField, BoxGroup("직접 추가하는 영역")]
|
|
public Sprite Sprite { get; set; }
|
|
|
|
[field: SerializeField, BoxGroup("직접 추가하는 영역")]
|
|
public Item ItemPrefab { get; set; }
|
|
|
|
[JsonConstructor]
|
|
public ItemData(string idx, string name, ItemType type, IngredientType ingredientType, ItemQuality quality, int price,
|
|
int weight, string description, Sprite sprite, Item itemPrefab)
|
|
{
|
|
Idx = idx;
|
|
Name = name;
|
|
Type = type;
|
|
IngredientType = ingredientType;
|
|
Quality = quality;
|
|
Price = price;
|
|
Weight = weight;
|
|
Description = description;
|
|
Sprite = sprite;
|
|
ItemPrefab = itemPrefab;
|
|
}
|
|
|
|
public ItemData(ItemData itemData)
|
|
{
|
|
Idx = itemData.Idx;
|
|
Name = itemData.Name;
|
|
Type = itemData.Type;
|
|
IngredientType = itemData.IngredientType;
|
|
Quality = itemData.Quality;
|
|
Price = itemData.Price;
|
|
Weight = itemData.Weight;
|
|
Description = itemData.Description;
|
|
Sprite = itemData.Sprite;
|
|
ItemPrefab = itemData.ItemPrefab;
|
|
}
|
|
}
|
|
} |