Merge pull request #95335 from esainane/error-to-sender

Fix documentation of `EditorImportPlugin._Import`
This commit is contained in:
Rémi Verschelde 2024-08-12 14:10:16 +02:00
commit 1d7b318d24
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 3 additions and 3 deletions

View File

@ -98,18 +98,18 @@
};
}
public override int _Import(string sourceFile, string savePath, Godot.Collections.Dictionary options, Godot.Collections.Array<string> platformVariants, Godot.Collections.Array<string> genFiles)
public override Error _Import(string sourceFile, string savePath, Godot.Collections.Dictionary options, Godot.Collections.Array<string> platformVariants, Godot.Collections.Array<string> genFiles)
{
using var file = FileAccess.Open(sourceFile, FileAccess.ModeFlags.Read);
if (file.GetError() != Error.Ok)
{
return (int)Error.Failed;
return Error.Failed;
}
var mesh = new ArrayMesh();
// Fill the Mesh with data read in "file", left as an exercise to the reader.
string filename = $"{savePath}.{_GetSaveExtension()}";
return (int)ResourceSaver.Save(mesh, filename);
return ResourceSaver.Save(mesh, filename);
}
}
[/csharp]