fixed item repository bug
This commit is contained in:
@@ -83,13 +83,11 @@ public partial class FieldBehaviour2D : Sprite2D
|
||||
|
||||
if (item == null || PlantingPlaceholder.GetChildCount() > 0)
|
||||
return success;
|
||||
|
||||
|
||||
string prefabPath = ItemRepository.TryGetPrefabPath(item.blueprint);
|
||||
|
||||
if (prefabPath != null)
|
||||
{
|
||||
|
||||
// todo: Error: cannot convert value at key from string to object
|
||||
PackedScene prefab = ResourceLoader.Load<PackedScene>(prefabPath, nameof(PackedScene));
|
||||
Node2D plant2d = prefab.Instantiate<Node2D>();
|
||||
PlantingPlaceholder.AddChild(plant2d);
|
||||
@@ -102,7 +100,6 @@ public partial class FieldBehaviour2D : Sprite2D
|
||||
}
|
||||
|
||||
success = true;
|
||||
|
||||
}
|
||||
|
||||
return success;
|
||||
|
||||
Reference in New Issue
Block a user