Пример #1
0
        public override void OnMove(Tile target)
        {
            Path path = Pathfinding.FindPath(Tile, target);

            Fortified     = false;
            MovementLeft -= path.movementCost;
            Owner.ChangeFuel(Cost);
            EntityBar.GetComponent <EntityBar>().SetMoveSize(MovementLeft / MaxMovement);
            StartCoroutine(Move(target));
        }
Пример #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();
            }
        }