Added new stanok
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(
|
||||
fileName = "ItemProcessingRecipe",
|
||||
menuName = "FORT-BO/Workstations/Item Processing Recipe")]
|
||||
public sealed class ItemProcessingRecipe : ScriptableObject
|
||||
{
|
||||
[SerializeField] private string recipeId;
|
||||
[SerializeField] private ItemDefinition inputItem;
|
||||
[SerializeField] private ItemDefinition outputItem;
|
||||
[SerializeField, Min(0.05f)] private float processingDuration = 3f;
|
||||
|
||||
public string RecipeId => recipeId;
|
||||
public ItemDefinition InputItem => inputItem;
|
||||
public ItemDefinition OutputItem => outputItem;
|
||||
public float ProcessingDuration => processingDuration;
|
||||
|
||||
public bool Accepts(NetworkItem item)
|
||||
{
|
||||
if (item == null || item.Definition == null || inputItem == null)
|
||||
return false;
|
||||
|
||||
return item.Definition == inputItem ||
|
||||
(!string.IsNullOrEmpty(inputItem.ItemId) && item.ItemId == inputItem.ItemId);
|
||||
}
|
||||
|
||||
private void OnValidate() =>
|
||||
recipeId = recipeId?.Trim().ToLowerInvariant();
|
||||
}
|
||||
Reference in New Issue
Block a user