public override IEnumerator Tile() { if (BattleSystem.SelectedUnit.tilesWithinMovement.Contains(BattleSystem.SelectedTile)) { HighlightManager.UnHighlightTileList(BattleSystem.SelectedUnit.tilesWithinMovement); if (BattleSystem.SelectedTile.CanMoveTo()) { BattleSystem.SelectedUnit.OnMove(BattleSystem.SelectedTile); } } yield return(new WaitForSeconds(0f)); }
// Update is called once per frame void Update() { if (from != null && to != null) { path = Pathfinding.FindPath(from, to); foreach (Tile t in allTiles) { if (!path.tiles.Contains(t)) { notPathTiles.Add(t); } } HighlightManager.UnHighlightTileList(notPathTiles); HighlightManager.HighlightTileList(path.tiles); notPathTiles.Clear(); } }
public override IEnumerator Tile() { //if (BattleSystem.SelectedUnit.Tile.CanStrikeTile(BattleSystem.SelectedTile, BattleSystem.SelectedUnit.GetRange())) if (BattleSystem.SelectedUnit.tilesWithinRange.Contains(BattleSystem.SelectedTile)) { HighlightManager.UnHighlightTileList(BattleSystem.SelectedUnit.tilesWithinRange); Tile targetTile = BattleSystem.SelectedTile; targetTile.strikeParticles.Play(); if (BattleSystem.SelectedUnit.GetSplash()) { targetTile.SplashDamage(BattleSystem.SelectedUnit.GetDamage()); } else { targetTile.DistributeDamage(BattleSystem.SelectedUnit.GetDamage()); } BattleSystem.SelectedUnit.OnStrike(); } BattleSystem.Player(); yield return(new WaitForSeconds(0f)); }