| | |
| | | m_Tiles[x, y] = newTile; |
| | | newTile.SetTileType(m_arrGridType[x, y]); |
| | | newTile.SetRender(false, "");//初始化不显示 |
| | | |
| | | if (m_arrGridType[x, y] == PlacementGridType.EGridWaitBuy) |
| | | { |
| | | newTile.SetWarning(true); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | /// <param name="y"></param> |
| | | public void CheckCanPlaceUpdate(int x, int y, bool isEmpty, string towerName) |
| | | { |
| | | CloseCanPlace(); |
| | | currentCanPlace = m_Tiles[x, y]; |
| | | currentCanPlace?.SetRender(true, isEmpty ? towerName : ""); |
| | | if (currentCanPlace == null) |
| | | { |
| | | //Debug.Log("第一次"); |
| | | currentCanPlace = m_Tiles[x, y]; |
| | | currentCanPlace?.SetRender(true, isEmpty ? towerName : ""); |
| | | } |
| | | else if (currentCanPlace.GridPosition.x != x || currentCanPlace.GridPosition.y != y) |
| | | { |
| | | CloseCanPlace(); |
| | | currentCanPlace = m_Tiles[x, y]; |
| | | currentCanPlace?.SetRender(true, isEmpty ? towerName : ""); |
| | | } |
| | | // if (isEmpty) |
| | | // { |
| | | // currentCanPlace.SetTowerVirtualshadow(towerName); |
| | |
| | | /// </summary> |
| | | public void CloseCanPlace() |
| | | { |
| | | //Debug.Log("CloseCanPlace:" + currentCanPlace); |
| | | if (currentCanPlace != null) |
| | | { |
| | | currentCanPlace.SetRender(false, ""); |