✨ Added sceneprovider reference to field scripts and made them register on ready. Also added VariableSetter.
This commit is contained in:
@@ -15,6 +15,7 @@ public partial class FarmingControls2D : Node2D
|
||||
[Export] private CpuParticles2D _wateringParticles;
|
||||
[Export] private float _wateringCanParticlesVerticalOffset = 50f;
|
||||
[Export] private Vector2I _fieldOffsetVector = new Vector2I(735, 651);
|
||||
[Export] private Node2D _fieldParent;
|
||||
|
||||
private int _toolId = -1;
|
||||
private bool _wateringCanFilled = false;
|
||||
@@ -143,13 +144,11 @@ public partial class FarmingControls2D : Node2D
|
||||
// reposition and reparent the instance
|
||||
field2d.Position = new Vector2(fieldPosition.X, fieldPosition.Y);
|
||||
|
||||
FieldService.Instance.AddChild(fieldInstance);
|
||||
_fieldParent.AddChild(fieldInstance);
|
||||
EmitSignal(SignalName.FieldCreated);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user