Пример #1
0
    private void ClickCauldron()
    {
        if (m_hand.HasIngredient)
        {
            Debug.Log("OK");
            if (m_hand.PutIngredientIntoCauldron())
            {
                EnableSpoonContent(false);
            }
        }
        else
        {
            // Préparation de la potion
            var maker = m_hand.Cook();

            if (maker != null)
            {
                // Création du GameObject de la potion
                var potion = Instantiate(PotionPrefab);
                potion.transform.position = new Vector3(100f, 100f, 100f);
                potion.GetComponent <Potion>().Effects = maker.GetEffects();
                Vitruve.instance.DrinkPotion(potion.GetComponent <Potion>());
            }
        }
    }