예제 #1
0
        private void HandleMouseOnTile(IntVector2 tileCoords)
        {
            if (_gridCellHighlight != null)
            {
                _gridCellHighlightPool.Despawn(_gridCellHighlight);
            }

            _gridCellHighlight = _gridCellHighlightPool.Spawn(tileCoords, new Color(1, 0, 0, 0.4f));
        }
예제 #2
0
        public void HandleActionPlanned(IUnit unit)
        {
            var coords = _gridUnitManager.GetUnitCoords(unit);

            if (coords == null)
            {
                _logger.LogError(LoggedFeature.Units, "Unit not in tile: {0}", unit);
                return;
            }

            var baseSpeedTiles =
                _gridPositionCalculator.GetTilesAtDistance(coords.Value, unit.UnitData.UnitStats.speed / 5);

            foreach (var tileCoords in baseSpeedTiles)
            {
                _gridCellHighlightPool.Spawn(tileCoords, new Color(0, 1, 0, 0.6f));
                _validTiles.Add(tileCoords);
            }
        }