Ejemplo n.º 1
0
        public void SetDisplayType(CellOverlayType type)
        {
            Clear();

            if (type == CellOverlayType.Labels)
            {
                CoordinateLabel.text = CellToDisplay.Coordinates.ToStringOnSeparateLines();
                CoordinateLabel.gameObject.SetActive(true);
            }
            else if (type == CellOverlayType.PathIndicator)
            {
                PathIndicator.gameObject.SetActive(true);
            }
            else if (type == CellOverlayType.AttackIndicator)
            {
                AttackIndicator.gameObject.SetActive(true);
            }
            else if (type == CellOverlayType.UnreachableIndicator)
            {
                UnreachableIndicator.gameObject.SetActive(true);
            }
            else if (type == CellOverlayType.SelectedIndicator)
            {
                SelectedIndicator.gameObject.SetActive(true);
            }
        }
Ejemplo n.º 2
0
        public void ShowOverlayOfCell(IHexCell cell, CellOverlayType type)
        {
            HexCellOverlay overlayToShow;

            if (!OverlayOfCell.TryGetValue(cell, out overlayToShow))
            {
                overlayToShow = OverlayPool.Spawn();

                OverlayOfCell[cell] = overlayToShow;
            }

            overlayToShow.SetDisplayType(type);
            overlayToShow.CellToDisplay = cell;
            overlayToShow.Show();
        }