Stuff
This commit is contained in:
@@ -5,11 +5,6 @@ namespace Slimepire.Gameplay.Nodules;
|
||||
[SceneTree]
|
||||
public partial class Nodule : Node2D
|
||||
{
|
||||
[Export]
|
||||
public bool IsRoot;
|
||||
|
||||
private BuildGhost? _ghost;
|
||||
|
||||
private bool _mouseInsideClickArea;
|
||||
private bool _clickedInside;
|
||||
|
||||
@@ -26,7 +21,7 @@ public partial class Nodule : Node2D
|
||||
TubeConnectionArea.AreaEntered += TubeConnectionAreaOnAreaEntered;
|
||||
TubeConnectionArea.AreaExited += TubeConnectionAreaOnAreaExited;
|
||||
|
||||
TubeManager.Instance.RegisterNodule(this);
|
||||
NoduleManager.Instance.RegisterNodule(this);
|
||||
}
|
||||
|
||||
private void TubeConnectionAreaOnAreaEntered(Area2D area)
|
||||
@@ -34,7 +29,7 @@ public partial class Nodule : Node2D
|
||||
if (area.GetParent() is Nodule nodule)
|
||||
{
|
||||
Connections.Add(nodule);
|
||||
TubeManager.Instance.Update();
|
||||
NoduleManager.Instance.Update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,23 +63,24 @@ public partial class Nodule : Node2D
|
||||
_mouseInsideClickArea = false;
|
||||
|
||||
// ghost == null check probably unnecessary
|
||||
if (_clickedInside && _ghost == null)
|
||||
if (_clickedInside && !NoduleManager.Instance.Building)
|
||||
{
|
||||
NoduleManager.Instance.Building = true;
|
||||
_clickedInside = false;
|
||||
_isExpanding = true;
|
||||
|
||||
_ghost = Instantiator.Instantiate<BuildGhost>();
|
||||
_ghost.Position = Position;
|
||||
_ghost.OnBuild += OnBuildComplete;
|
||||
var ghost = Instantiator.Instantiate<BuildGhost>();
|
||||
ghost.Position = Position;
|
||||
// ghost.OnBuild += OnBuildComplete;
|
||||
|
||||
GetParent()?.AddChild(_ghost);
|
||||
GetParent()?.AddChild(ghost);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnBuildComplete(Vector2 pos)
|
||||
{
|
||||
NoduleManager.Instance.Building = false;
|
||||
_isExpanding = false;
|
||||
_ghost = null;
|
||||
|
||||
var nodule = Instantiator.Instantiate<Nodule>();
|
||||
|
||||
|
||||
@@ -58,6 +58,8 @@ frame_progress = 0.9100785
|
||||
|
||||
[node name="TubeConnectionArea" type="Area2D" parent="." unique_id=339547035]
|
||||
unique_name_in_owner = true
|
||||
collision_layer = 2
|
||||
collision_mask = 2
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="TubeConnectionArea" unique_id=234655540]
|
||||
shape = SubResource("CircleShape2D_x44k2")
|
||||
|
||||
Reference in New Issue
Block a user