public void AddIngredient(int slotIndex) { short indexOfFindess = 0; bowl.setRequirment(TypeNameCase(slotIndex), requirmentSprites[(slotIndex / 2 + 1) - 1], quantitysToAdd[slotIndex]); if (recipeList.Count == 0) { return; } foreach (Recipe r in recipeList) { short newIndexOfFindess = bowl.CheckMenuList(r.reqList, (short)r.reqList.Count); if (newIndexOfFindess == 2) { bowl.compatibleList = r; } if (newIndexOfFindess > indexOfFindess) { indexOfFindess = newIndexOfFindess; } } switch (indexOfFindess) { case 0: bowl.ChangeMyColor(wrongRecipeColor); break; case 1: bowl.ChangeMyColor(missingRecipeColor); break; case 2: bowl.ChangeMyColor(correctRecipeColor); correctRecipe = bowl.compatibleList; confirmBtn.SetActive(true); break; } }