bug fixed
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
// ReSharper disable MemberCanBePrivate.Global
|
||||
|
||||
namespace BITKit;
|
||||
@@ -12,6 +14,10 @@ public partial class NodeBuilder : Node
|
||||
[Export] private Control emptyHints;
|
||||
[ExportCategory("Template")]
|
||||
[Export] private PackedScene template;
|
||||
|
||||
public Node[] Instances => _instances.ToArray();
|
||||
private readonly List<Node> _instances = new List<Node>();
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
if (clearOnStart)
|
||||
@@ -45,11 +51,14 @@ public partial class NodeBuilder : Node
|
||||
}
|
||||
|
||||
emptyHints?.Hide();;
|
||||
|
||||
_instances.Add(instance);
|
||||
return instance as T;
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
_instances.Clear();
|
||||
emptyHints?.Show();
|
||||
if (clearTemplateOnly)
|
||||
{
|
||||
|
Reference in New Issue
Block a user