Exemple #1
0
    // Player actions on a available ingredient
    void CaptureIngredient()
    {
        Ingredient newIngredient = Ingredient.Grab(m_focusIngredient.m_ingredientType);

        if (newIngredient != null)
        {
            Main.AUDIO_Pickup();

            Main.SendFloater(m_focusIngredient.transform.position, 2.0f, ("You picked up " + newIngredient.m_ingredientType.ToString()));

            Vector3 offset = 0.2f * Ingredient.GetPlacementOffset(m_ingredients.Count);

            newIngredient.transform.localScale   *= 0.75f;
            newIngredient.transform.localPosition = Vector3.zero;
            newIngredient.transform.position      = m_model.GetHolder().transform.position + offset;
            newIngredient.transform.parent        = m_model.GetHolder().transform;

            if (!m_ingredients.Contains(newIngredient))
            {
                m_ingredients.Add(newIngredient);
            }

            newIngredient.m_grabbedByPlayer = true;

            //   Main.SendFloater(m_model.transform.position, 2.0f, ("You picked up " + newIngredient.m_ingredientType.ToString()));
        }
    }