public void AddBurgerIngredient(BurgerIngredient burgerIngredient) { try { context.Add(burgerIngredient); context.SaveChanges(); } catch (Exception ex) { _logger.LogError(ex.StackTrace); throw new ConnectionFailedException(); } }
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); }