Ejemplo n.º 1
0
        private void ChangeData(int replaceIndex)
        {
            if (replaceIndex < 0)
            {
                return;
            }

            for (int i = 0; i < m_pattern.LineCount; i++)
            {
                if (m_items.Count <= replaceIndex + i)
                {
                    continue;
                }

                if (m_items[replaceIndex + i] == null)
                {
                    continue;
                }

                // Find DataIndex
                int dataIndex = m_pattern.GetDataIndex(m_items[replaceIndex + i].Owner);

                if (dataIndex >= 0 && dataIndex < m_datas.Count)
                {
                    // item info Settings.
                    m_items[replaceIndex + i].SetInfo(m_datas[dataIndex], m_receiver);
                    m_items[replaceIndex + i].ConnectActionModule(m_action);
                    m_items[replaceIndex + i].SetAlive(true);
                }
                else
                {
                    m_items[replaceIndex + i].SetAlive(false);
                }
            }
        }
Ejemplo n.º 2
0
 private int GetItemDataIndex(int itemIndex)
 {
     return(m_pattern.GetDataIndex(m_items[itemIndex].Owner));
 }