From fbc055308f093a6527781cb16ce896ac253219ab Mon Sep 17 00:00:00 2001 From: Matheus Date: Thu, 4 Sep 2025 12:46:30 -0300 Subject: Modificado inspetor --- scripts/actors/Inspector.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'scripts/actors') 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; /// public partial class Inspector : Sprite2D { - private static readonly Texture2D texture = GD.Load("res://assets/sprites/inspector.png"); - private Vector2I gridPosition = Vector2I.Zero; /// /// 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"); + camera.Enabled = true; + camera.MakeCurrent(); + + SignalBus.Instance.EmitSignal(SignalBus.SignalName.InspectorMoved, GridPosition); } /// @@ -35,5 +35,6 @@ public partial class Inspector : Sprite2D /// public void Walk(Vector2I offset) { GridPosition += offset; + SignalBus.Instance.EmitSignal(SignalBus.SignalName.InspectorMoved, GridPosition); } } \ No newline at end of file -- cgit v1.2.3