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); } } }
private int GetItemDataIndex(int itemIndex) { return(m_pattern.GetDataIndex(m_items[itemIndex].Owner)); }