Пример #1
0
        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));
        }
Пример #2
0
        // 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();
            }
        }
Пример #3
0
        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));
        }
Пример #4
0
 public void OnUnitStrike()
 {
     HighlightManager.HighlightTileList(SelectedUnit.tilesWithinRange);
     StartCoroutine(State.Strike(SelectedTile));
 }
Пример #5
0
 public void OnUnitMove()
 {
     HighlightManager.HighlightTileList(SelectedUnit.tilesWithinMovement);
     StartCoroutine(State.Move(SelectedTile));
 }