AssemblyCSharp.UISlots.OnDrop C# (CSharp) Method

OnDrop() public method

public OnDrop ( UIDropEvent e ) : void
e UIDropEvent
return void
        void OnDrop(UIDropEvent e)
        {
            var ingredient = e.DroppedObject.GetComponent<UIIngredient> ().Ingredient;
            var ingredientID = ingredient.IngredientID;
            _ingredients [ingredientID] = ingredient;

            if (_ingredients.Count == 3) {
                ServiceLocator.Get<GameStateService> ().Write (gameState => {
                    _ingredients.Values.ForEach (ingr => gameState.UseIngredient (ingr.IngredientID));
                });

                HideIngredients ();
                var match = ServiceLocator.Get<PlayService> ().FindMatch (new List<Ingredient> (_ingredients.Values));

                MatchResult.Init (match);
                MatchResult.gameObject.SetActive (true);
            }
        }