add LdtkFieldInstance and LdtkEntityMap classes; update LdtkSceneBuilder to support entity mapping
This commit is contained in:
@@ -44,9 +44,11 @@ public partial class LdtkResourceImporter : EditorImportPlugin
|
||||
GD.PushError("Parsed LDTK data is null.");
|
||||
return Error.Failed;
|
||||
}
|
||||
|
||||
var entityMap = options.TryGetValue("entity_map", out var map) ? map.As<LdtkEntityMap>() : null;
|
||||
|
||||
// 3. Use the Scene Builder to generate the Godot scene
|
||||
var builder = new LdtkSceneBuilder(ldtkData, sourceFile);
|
||||
var builder = new LdtkSceneBuilder(ldtkData, sourceFile, entityMap);
|
||||
var rootNode = builder.BuildLdtkProjectRoot();
|
||||
|
||||
var scene = new PackedScene();
|
||||
@@ -78,6 +80,13 @@ public partial class LdtkResourceImporter : EditorImportPlugin
|
||||
{ "name", "import_tilemaps" },
|
||||
{ "default_value", true },
|
||||
{ "usage", (int)(PropertyUsageFlags.Default | PropertyUsageFlags.UpdateAllIfModified) }
|
||||
},
|
||||
new()
|
||||
{
|
||||
{ "name", "entity_map" },
|
||||
{ "default_value", new LdtkEntityMap() },
|
||||
{ "property_hint", (int)PropertyHint.ResourceType },
|
||||
{ "hint_string", "LdtkEntityMap" },
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user