public void SetText(BlockData _data) { if (_data.GetBlockType() == BlockData.EBlockType.Normal) //只有當我發現你是普通格子時,我才會去更動我的數字 { this.SetText(_data.GetBlockValue()); } }
public void SpawnBlock(int _iSpawnPos, BlockData _block) //生成格子 { if (this.m_listBoard != null && _iSpawnPos < this.m_iBoardSize) //只在棋盤有被生出來,而且你選定的索引值在範圍內時才允許生成 { this.m_listBoard[_iSpawnPos].SetBlockValue(_block.GetBlockValue()); this.m_listBoard[_iSpawnPos].SetBlockType(_block.GetBlockType()); } }
public void SetBlock(BlockData _data) { switch (_data.GetBlockType()) { case BlockData.EBlockType.Normal: this.m_imgBlockFace.sprite = m_sprNormalFace; this.SetText(_data.GetBlockValue()); break; case BlockData.EBlockType.Obstruct: this.m_imgBlockFace.sprite = m_sprObstructFace; this.SetText(0); break; case BlockData.EBlockType.None: this.m_imgBlockFace.sprite = m_sprNoneFace; this.SetText(0); break; } }