mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:35:34 +00:00
25 lines
592 B
C#
25 lines
592 B
C#
using Godot;
|
|
using System;
|
|
using System.Linq;
|
|
using Godot.Collections;
|
|
|
|
public partial class TilemapAvoidance : TileMapLayer
|
|
{
|
|
|
|
[Export] private Array<TileMapLayer> _solidLayers;
|
|
|
|
public override bool _UseTileDataRuntimeUpdate(Vector2I coords)
|
|
{
|
|
// if (_solidLayer.GetUsedCellsById(0).Contains(coords))
|
|
// {
|
|
// return true;
|
|
// }
|
|
|
|
return _solidLayers.Aggregate(false, (current, layer) => current | layer.GetUsedCellsById(0).Contains(coords));
|
|
}
|
|
|
|
public override void _TileDataRuntimeUpdate(Vector2I coords, TileData tileData)
|
|
{
|
|
tileData.SetNavigationPolygon(0, null);
|
|
}
|
|
}
|