26 lines
996 B
C#
26 lines
996 B
C#
using UnityEngine;
|
|
|
|
[CreateAssetMenu(fileName = "SmeltingRecipe", menuName = "FORT-BO/Workstations/Smelting Recipe")]
|
|
public sealed class SmeltingRecipe : ScriptableObject
|
|
{
|
|
[SerializeField] private string recipeId;
|
|
[SerializeField] private string displayName;
|
|
[SerializeField] private ItemDefinition outputItem;
|
|
[SerializeField, Min(1)] private int outputAmount = 1;
|
|
[SerializeField, Min(0.01f)] private float metalCost = 25f;
|
|
[SerializeField, Min(0.05f)] private float processingDuration = 3f;
|
|
|
|
public string RecipeId => recipeId;
|
|
public string DisplayName => string.IsNullOrWhiteSpace(displayName) ? name : displayName;
|
|
public ItemDefinition OutputItem => outputItem;
|
|
public int OutputAmount => outputAmount;
|
|
public float MetalCost => metalCost;
|
|
public float ProcessingDuration => processingDuration;
|
|
|
|
private void OnValidate()
|
|
{
|
|
recipeId = recipeId?.Trim().ToLowerInvariant();
|
|
displayName = displayName?.Trim();
|
|
}
|
|
}
|