First adjustments to the Entity System to make it work with different types
This commit is contained in:
@@ -1,16 +1,14 @@
|
||||
using Babushka.scripts.CSharp.GameEntity.Types;
|
||||
using Godot;
|
||||
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;
|
||||
[Export] private Dictionary<string, PackedScene> _entityPrefabs;
|
||||
|
||||
public T Create<T>(EntityType type) where T:Entity
|
||||
public Node2D CreateNode2D(string type)
|
||||
{
|
||||
return _entityPrefabs[type].Instantiate<T>();
|
||||
return _entityPrefabs[type].Instantiate<Node2D>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user