From 913854502862ddc1063961c4b56b1985bfa698c0 Mon Sep 17 00:00:00 2001 From: vaporvee Date: Tue, 15 Nov 2022 18:25:54 +0100 Subject: [PATCH] readded tilemap allCells[] wich got missing --- src/tilemap_foreground.cs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/tilemap_foreground.cs b/src/tilemap_foreground.cs index c762468..b26916e 100644 --- a/src/tilemap_foreground.cs +++ b/src/tilemap_foreground.cs @@ -1,10 +1,9 @@ using Godot; using System; +using System.Linq; public class tilemap_foreground : TileMap { - [Export] - bool ReplaceStaticTilesWithNodes = true; public override void _Process(float delta) { @@ -12,18 +11,15 @@ public class tilemap_foreground : TileMap public override void _Ready() { - if (ReplaceStaticTilesWithNodes) - { - ReplaceStaticTiles(1); - } + ReplaceStaticTiles(1); } public void ReplaceStaticTiles(int CellID) { - //Vector2[] AllCells = GetUsedCellsById(CellID); //why isnt it just a normal array wtf - // for(int i = 0; i == AllCells.Length; i++) - // { - // GD.Print(AllCells[i]); - // } + Vector2[] allCells = GetUsedCellsById(CellID).OfType().ToArray(); + for(int i = 0; i < allCells.Length; i++) + { + GD.Print(allCells[i]); + } } }