private void SelectCursorTile() { if (current.tiles[CursorTile[0], CursorTile[1]] != TILE_TYPE.PATH) { currentSelect = current; SelectedTile[0] = CursorTile[0]; SelectedTile[1] = CursorTile[1]; float centerX, centerZ; GetTileCenter(SelectedTile[1], SelectedTile[0], out centerX, out centerZ); MapCursorSelect.transform.localPosition = new Vector3(centerX + currentSelect.Section.y * MapSize, MapHeight + 0.005f, centerZ + currentSelect.Section.x * MapSize); MapCursorSelect.SetActive(true); TileIsSelected = true; } }
public void FinishSetup() { TileSize = ((float)MapSize / (float)MapGridSize); // In case we have rectangular maps later // BottomLeft[0] = (float)MapSize / -2.0f; BottomLeft[1] = (float)MapSize / -2.0f; Vector3 lp = MapCursor.transform.localPosition; MapCursor.transform.localPosition = new Vector3(lp.x, MapHeight + 0.0125f, lp.z); MapCursor.transform.localScale = new Vector3(TileSize * 0.95f, 0.025f, TileSize * 0.95f); MapCursorRenderer = MapCursor.GetComponent <MeshRenderer>(); MapCursor.SetActive(false); MapCursorSelect.transform.localPosition = new Vector3(lp.x, MapHeight + 0.005f, lp.z); MapCursorSelect.transform.localScale = new Vector3(TileSize * 0.93f, 0.01f, TileSize * 0.93f); MapCursorSelect.SetActive(false); CamController.transform.position = new Vector3(0, MapSize, 0); CamController.transform.LookAt(new Vector3(0, -1.0f, 0)); CamController.SetResetValuesWithCurrentValues(); }
private void DeselectTile() { MapCursorSelect.SetActive(false); TileIsSelected = false; }