19 lines
505 B
C#
19 lines
505 B
C#
using Godot;
|
|
|
|
|
|
[Tool]
|
|
public partial class ZE_AssetBrowser : HBoxContainer
|
|
{
|
|
const string ZOMBIE_PATH = "res://assets/zombies/";
|
|
private PackedScene scene = ResourceLoader.Load<PackedScene>("uid://iwnklc62rni8");
|
|
public override void _Ready()
|
|
{
|
|
foreach (var file in ResourceLoader.ListDirectory(ZOMBIE_PATH))
|
|
{
|
|
var data = ResourceLoader.Load<ZombieResource>(ZOMBIE_PATH + file);
|
|
var button = scene.Instantiate<ZE_AssetBrowserButton>();
|
|
button.SetData(data);
|
|
AddChild(button);
|
|
}
|
|
}
|
|
}
|