You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Babushka/scripts/CSharp/GameEntity/Management/EntityNodeCreator.cs

16 lines
459 B

using Babushka.scripts.CSharp.GameEntity.Types;
using Godot;
using Godot.Collections;
using Entity = Babushka.scripts.CSharp.GameEntity.Entities.Entity;
namespace Babushka.scripts.CSharp.GameEntity.Management;
public partial class EntityNodeCreator : Node
{
[Export] private Dictionary<EntityType, PackedScene> _entityPrefabs;
public T Create<T>(EntityType type) where T:Entity
{
return _entityPrefabs[type].Instantiate<T>();
}
}