mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-11 06:06:01 +00:00
New navigation
This commit is contained in:
parent
c8cbad3268
commit
86f7459837
8 changed files with 119 additions and 56 deletions
|
|
@ -64,6 +64,8 @@ public partial class GameManager : Node2D
|
|||
[Export]
|
||||
public int EggStartIndex = 0;
|
||||
|
||||
[Export] public NavigationRegion2D NavigationRegion { get; private set; }
|
||||
|
||||
// Called when the node enters the scene tree for the first time.
|
||||
public override void _Ready()
|
||||
{
|
||||
|
|
@ -143,6 +145,8 @@ public partial class GameManager : Node2D
|
|||
{
|
||||
Unpause();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void DelayPlayerSpawn()
|
||||
|
|
@ -365,12 +369,20 @@ public partial class GameManager : Node2D
|
|||
|
||||
public void RecalculateTilemap(Vector2 position)
|
||||
{
|
||||
CallDeferred(MethodName.RecalculateTilemapDeferred, position);
|
||||
//CallDeferred(MethodName.RecalculateTilemapDeferred, position);
|
||||
}
|
||||
|
||||
private void RecalculateTilemapDeferred(Vector2 position)
|
||||
{
|
||||
NavigationTilemap.Recalculate(position);
|
||||
//NavigationTilemap.Recalculate(position);
|
||||
GD.Print("Rebaking tilemap");
|
||||
NavigationRegion.BakeNavigationPolygon(true);
|
||||
}
|
||||
|
||||
public void RebakeNavigation()
|
||||
{
|
||||
GD.Print("Rebaking tilemap");
|
||||
//NavigationRegion.BakeNavigationPolygon(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue