Exemple #1
0
    public void CheckMerge()
    {
        bool mergeSlotsFilled = true;

        foreach (var slot in m_mergeSlots)
        {
            if (slot.IsEmpty())
            {
                mergeSlotsFilled = false;
                break;
            }
        }

        if (mergeSlotsFilled)
        {
            Debug.Log(string.Format("Slot 1: {0}, Slot 2: {1}", m_mergeSlots[0].GetElement().m_id, m_mergeSlots[1].GetElement().m_id));
            var createdElement = m_elementManager.CheckMerge(m_mergeSlots[0].GetElement(), m_mergeSlots[1].GetElement());

            if (createdElement != null && !m_elementManager.CheckCollected(createdElement))
            {
                ElementCreated(createdElement);
            }
            else
            {
                NoElementCreated();
            }
        }
    }