Esempio n. 1
0
 public void AddBurgerIngredient(BurgerIngredient burgerIngredient)
 {
     try {
         context.Add(burgerIngredient);
         context.SaveChanges();
     } catch (Exception ex) {
         _logger.LogError(ex.StackTrace);
         throw new ConnectionFailedException();
     }
 }
Esempio n. 2
0
    private void Attach(BurgerAttachableComponent attachable)
    {
        BurgerIngredient ingredient = attachable.GetIngredient();

        burgerIngredients.Add(ingredient);

        GameObject graphics = Instantiate(attachable.GraphicsPrefab, transform);

        graphics.transform.position = attachmentTrigger.transform.position;

        attachmentTrigger.transform.localPosition = attachmentTrigger.transform.localPosition + Vector3.up * attachable.IngredientHeight;

        if (ingredient.IngredientType == BurgerIngredientType.BUN_TOP)
        {
            attachmentTrigger.enabled = false;
        }

        Destroy(attachable.gameObject);
    }