// helper to make hole public void MakeHole() { // does nothing if already has hole if (m_hasHole) { return; } // initialize hole state and display m_hasHole = true; m_holeDisplay = WallDisplay.GetFromPool(GameManager.s_gameSettings.wallDisplayPrefab); m_holeDisplay.Initialize(m_root.transform, new Vector2(m_position.x, m_position.y - 1), GameManager.s_gameSettings.holeSprite); }
// constructor public Cell(WallState wallState, Vector2 position, GameObject root) { // initialize position m_position = position; m_root = root; // initialize wall state and display m_wallState = wallState; m_wallDisplay = WallDisplay.GetFromPool(GameManager.s_gameSettings.wallDisplayPrefab); m_wallDisplay.Initialize(m_root.transform, m_position, GameManager.s_gameSettings.GetWallSprite(m_wallState)); // start out with no hole m_hasHole = false; m_holeDisplay = null; }