-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathItemRecipe.cs
41 lines (34 loc) · 1007 Bytes
/
ItemRecipe.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System.Collections.Generic;
using TheForest.Utils;
using UnityEngine;
namespace BuilderMenu
{
public class ItemRecipe : MonoBehaviour
{
public ItemVariables vars;
public Dictionary<int,int> Ingredients;
public bool PlaceItem()
{
foreach (KeyValuePair<int,int> pair in Ingredients)
{
if (LocalPlayer.Inventory.RemoveItem(pair.Key))
{
Ingredients[pair.Key]--;
if (Ingredients[pair.Key] <= 0)
{
Ingredients.Remove(pair.Key);
}
return true;
}
}
if (Ingredients.Count <= 0)
{
vars.blueprint.Finish();
}
return false;
}
public void Finish()
{
}
}
}