mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:35:34 +00:00
Made tilemap navigation use multiple layers
This commit is contained in:
parent
fa49fe2ce9
commit
25670dc243
7 changed files with 32 additions and 22 deletions
|
|
@ -1,19 +1,21 @@
|
|||
using Godot;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Godot.Collections;
|
||||
|
||||
public partial class TilemapAvoidance : TileMapLayer
|
||||
{
|
||||
|
||||
[Export] private TileMapLayer _solidLayer;
|
||||
[Export] private Array<TileMapLayer> _solidLayers;
|
||||
|
||||
public override bool _UseTileDataRuntimeUpdate(Vector2I coords)
|
||||
{
|
||||
if (_solidLayer.GetUsedCellsById(0).Contains(coords))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// if (_solidLayer.GetUsedCellsById(0).Contains(coords))
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
return false;
|
||||
return _solidLayers.Aggregate(false, (current, layer) => current | layer.GetUsedCellsById(0).Contains(coords));
|
||||
}
|
||||
|
||||
public override void _TileDataRuntimeUpdate(Vector2I coords, TileData tileData)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue