コード例 #1
0
    private void ReleaseIngredient()
    {
        if (_currentIngredient != null)
        {
            if (GetCurrentField.HasContent)
            {
                Ingredient temp;
                if (Combine(_currentIngredient, GetCurrentField.Ingredient, out temp))
                {
                    GetCurrentField.SetIngredient(temp);
                    GetCurrentWorldRepresentation().ChangeSprite(IngredientSprite(temp.ingredientType));

                    if (_currentWorldRepresentation != GetCurrentWorldRepresentation())
                    {
                        _currentWorldRepresentation.DeleteSprite();
                    }
                }
                else
                {
                    _lastField.SetIngredient(_currentIngredient);
                }
            }
            else
            {
                ChangeField();
            }
            _currentWorldRepresentation.ReturnToStart();
            _currentWorldRepresentation.Lift(false);
            _currentIngredient = null;
        }
    }
コード例 #2
0
 private void PickUpIngredient(Ingredient fieldIngredient)
 {
     Debug.Log(fieldIngredient.ingredientType);
     _currentWorldRepresentation = GetCurrentWorldRepresentation();
     _currentIngredient          = fieldIngredient;
     _currentWorldRepresentation.ChangeSprite(IngredientSprite(fieldIngredient.ingredientType));
     GetCurrentField.SetIngredient(null);
     _lastField = GetCurrentField;
 }
コード例 #3
0
 private void ChangeField()
 {
     Debug.Log("Field changed");
     GetCurrentField.SetIngredient(_currentIngredient);
     GetCurrentWorldRepresentation().ChangeSprite(IngredientSprite(_currentIngredient.ingredientType));
     if (_currentWorldRepresentation != GetCurrentWorldRepresentation())
     {
         _currentWorldRepresentation.DeleteSprite();
     }
 }