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)); }
// 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(); } }