Example #1
0
 public static bool MaterialsMet(Recipe recipe)
 {
     if (recipe == null)
     {
         Debug.LogError("Trying to verify the materials on a null recipe!");
         return(false);
     }
     if (recipe.Ingredients == null || recipe.Ingredients.Count == 0)
     {
         Debug.LogError("Trying to verify the materials on a recipe with no MaterialCategoryTags!");
         return(false);
     }
     for (int i = 0; i < recipe.Ingredients.Count; i++)
     {
         MaterialSelectionPanel.SelectedElemInfo selectedElemInfo = MaterialSelectionPanel.Filter(recipe.Ingredients[i].tag);
         if (selectedElemInfo.kgAvailable < recipe.Ingredients[i].amount)
         {
             return(false);
         }
     }
     return(true);
 }
Example #2
0
 public new void Awake()
 {
     base.Awake();
     materialSelectionPanel = Util.KInstantiateUI <MaterialSelectionPanel>(materialSelectionPanelPrefab.gameObject, base.gameObject, false);
 }