File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Modules/GameManagers/Scripts Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,26 @@ namespace DungeonRoyale.Modules.GameManagers.Scripts;
6
6
7
7
public partial class TilesManager : Node2D
8
8
{
9
+ public static TilesManager ? Instance { get ; private set ; }
10
+
9
11
public DRTileData [ , ] Tiles { get ; private set ; } = new DRTileData [ 0 , 0 ] ;
10
12
11
13
private int _width ;
12
14
private int _height ;
13
15
16
+ public override void _Ready ( )
17
+ {
18
+ if ( Instance is null )
19
+ {
20
+ Instance = this ;
21
+ }
22
+ else
23
+ {
24
+ GD . PrintErr ( "There is already an instance of TilesManager in the scene." ) ;
25
+ }
26
+ }
27
+
28
+
14
29
public void SetUpTiles ( int width , int height )
15
30
{
16
31
_width = width ;
Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ run/main_scene="res://Modules/Game/Scenes/Game.tscn"
15
15
config/features =PackedStringArray ("4.4" , "C#" , "GL Compatibility" )
16
16
config/icon ="res://icon.svg"
17
17
18
+ [autoload ]
19
+
20
+ TilesManager ="*res://Modules/GameManagers/Scripts/TilesManager.cs"
21
+
18
22
[dotnet ]
19
23
20
24
project/assembly_name ="DungeonRoyale"
You can’t perform that action at this time.
0 commit comments