no hardcode PackManager
This commit is contained in:
parent
50f37ebc5f
commit
1058938043
1 changed files with 2 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ using System.Text.Json;
|
|||
public partial class ChunkManager : Node2D
|
||||
{
|
||||
[Export] public NodePath PlayerPath;
|
||||
[Export] public NodePath PackManagerPath;
|
||||
[Export] public int LoadRadius = 1; // 1 -> 3x3
|
||||
|
||||
private CharacterBody2D? _player;
|
||||
|
|
@ -24,7 +25,7 @@ public partial class ChunkManager : Node2D
|
|||
return;
|
||||
}
|
||||
|
||||
_packs = GetNodeOrNull<PackManager>("/root/Main/PackManager");
|
||||
_packs = GetNodeOrNull<PackManager>(PackManagerPath);
|
||||
if (_packs == null)
|
||||
{
|
||||
// fallback: search up the tree for PackManager
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue