void CrossUpNextCheck(Map.BLOCKCOLOR color, int index) //홀수일때 옆에꺼 (+col) 짝수일때 한칸 위 + (col - 1) { // // row 가 짝수면 같은 라인. row가 홀수면 대각선 아래 검사 // int NextCheckIndex = index + m_MapLoad.GetRowCount() - (((index / m_MapLoad.GetRowCount()) + 1) % 2); if (NextCheckIndex > m_MapLoad.GetRowCount() * m_MapLoad.GetColCount() || m_MapLoad.blocks[NextCheckIndex] == null) { TempMatchListIndex.Add(index); return; } BlockHive info = m_MapLoad.blocks[index].GetComponent <BlockHive>(); BlockHive info2 = m_MapLoad.blocks[NextCheckIndex].GetComponent <BlockHive>(); if (info2.blockobj == null) { TempMatchListIndex.Add(index); return; } if (info.GetBlockInfo().color == info2.GetBlockInfo().color&& info2.GetBlockInfo().type == Map.BLOCKTYPPE.BLOCK) { TempMatchListIndex.Add(index); CrossUpNextCheck(color, NextCheckIndex); } else { TempMatchListIndex.Add(index); } }
void DownNextCheck(Map.BLOCKCOLOR color, int index) { int NextCheckIndex = index + 1; if (NextCheckIndex > m_MapLoad.GetRowCount() * m_MapLoad.GetColCount() || m_MapLoad.blocks[NextCheckIndex] == null || NextCheckIndex % m_MapLoad.GetRowCount() == 0) { TempMatchListIndex.Add(index); return; } BlockHive info = m_MapLoad.blocks[index].GetComponent <BlockHive>(); BlockHive info2 = m_MapLoad.blocks[NextCheckIndex].GetComponent <BlockHive>(); if (info2.blockobj == null) { TempMatchListIndex.Add(index); return; } if (info.GetBlockInfo().color == info2.GetBlockInfo().color&& info2.GetBlockInfo().type == Map.BLOCKTYPPE.BLOCK) { TempMatchListIndex.Add(index); DownNextCheck(color, NextCheckIndex); } else { TempMatchListIndex.Add(index); } }
public void SetBlockColor(Map.BLOCKCOLOR color, bool IsBlock = true) { if (IsBlock) { blockobj.m_blockInfo.color = color; } switch (color) { case Map.BLOCKCOLOR.BLUE: m_renderer.color = Color.blue; break; case Map.BLOCKCOLOR.GREEN: m_renderer.color = Color.green; break; case Map.BLOCKCOLOR.PURPLE: m_renderer.color = Color.magenta; break; case Map.BLOCKCOLOR.RED: m_renderer.color = Color.red; break; case Map.BLOCKCOLOR.YELLOW: m_renderer.color = Color.yellow; break; case Map.BLOCKCOLOR.NONE: m_renderer.color = Color.white; break; } //PoolObject.GetComponent<BlockEvent>().color = m_blockInfo.color; }