Merge pull request #45846 from rcorre/importplugin_doc

Improve EditorImportPlugin docs.
This commit is contained in:
Rémi Verschelde 2021-02-11 12:24:48 +01:00 committed by GitHub
commit dca3ce441a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,7 +16,7 @@
return "my.special.plugin" return "my.special.plugin"
func get_visible_name(): func get_visible_name():
return "Special Mesh Importer" return "Special Mesh"
func get_recognized_extensions(): func get_recognized_extensions():
return ["special", "spec"] return ["special", "spec"]
@ -44,8 +44,7 @@
# Fill the Mesh with data read in "file", left as an exercise to the reader. # Fill the Mesh with data read in "file", left as an exercise to the reader.
var filename = save_path + "." + get_save_extension() var filename = save_path + "." + get_save_extension()
ResourceSaver.save(filename, mesh) return ResourceSaver.save(filename, mesh)
return OK
[/gdscript] [/gdscript]
[csharp] [csharp]
using Godot; using Godot;
@ -60,7 +59,7 @@
public override String GetVisibleName() public override String GetVisibleName()
{ {
return "Special Mesh Importer"; return "Special Mesh";
} }
public override Godot.Collections.Array GetRecognizedExtensions() public override Godot.Collections.Array GetRecognizedExtensions()
@ -104,8 +103,7 @@
var mesh = new ArrayMesh(); var mesh = new ArrayMesh();
// Fill the Mesh with data read in "file", left as an exercise to the reader. // Fill the Mesh with data read in "file", left as an exercise to the reader.
String filename = savePath + "." + GetSaveExtension(); String filename = savePath + "." + GetSaveExtension();
ResourceSaver.Save(filename, mesh); return (int)ResourceSaver.Save(filename, mesh);
return (int)Error.Ok;
} }
} }
[/csharp] [/csharp]
@ -220,7 +218,7 @@
<return type="String"> <return type="String">
</return> </return>
<description> <description>
Gets the name to display in the import window. Gets the name to display in the import window. You should choose this name as a continuation to "Import as", e.g. "Import as Special Mesh".
</description> </description>
</method> </method>
<method name="import" qualifiers="virtual"> <method name="import" qualifiers="virtual">