diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-09-04 12:46:30 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-09-04 12:46:30 -0300 |
| commit | fbc055308f093a6527781cb16ce896ac253219ab (patch) | |
| tree | d63357f7281784e03a12483fdd898a11293d8aa5 /scripts/actors | |
| parent | 6842ccfd372601db6b5d3f678ab5ebf03ad2b206 (diff) | |
Modificado inspetor
Diffstat (limited to 'scripts/actors')
| -rw-r--r-- | scripts/actors/Inspector.cs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/scripts/actors/Inspector.cs b/scripts/actors/Inspector.cs index 0bdab5b..e340543 100644 --- a/scripts/actors/Inspector.cs +++ b/scripts/actors/Inspector.cs @@ -5,8 +5,6 @@ using Godot; /// </summary> public partial class Inspector : Sprite2D { - private static readonly Texture2D texture = GD.Load<Texture2D>("res://assets/sprites/inspector.png"); - private Vector2I gridPosition = Vector2I.Zero; /// <summary> /// Posição do inspetor no espaço. Diferentemente de Position, GridPosition tem como formato @@ -22,11 +20,13 @@ public partial class Inspector : Sprite2D get => gridPosition; } - public Inspector(Vector2I initialPosition) - { - GridPosition = initialPosition; - Centered = false; - Texture = texture; + public override void _Ready() { + base._Ready(); + Camera2D camera = GetNode<Camera2D>("Camera2D"); + camera.Enabled = true; + camera.MakeCurrent(); + + SignalBus.Instance.EmitSignal(SignalBus.SignalName.InspectorMoved, GridPosition); } /// <summary> @@ -35,5 +35,6 @@ public partial class Inspector : Sprite2D /// <param name="offset"></param> public void Walk(Vector2I offset) { GridPosition += offset; + SignalBus.Instance.EmitSignal(SignalBus.SignalName.InspectorMoved, GridPosition); } }
\ No newline at end of file |
