16 lines
459 B
C#
16 lines
459 B
C#
|
|
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>();
|
||
|
|
}
|
||
|
|
}
|