Merge pull request #62114 from raulsntos/EditorScenePostImport_templates

Fix EditorScenePostImport templates for C#
This commit is contained in:
Rémi Verschelde 2022-06-16 19:58:14 +02:00 committed by GitHub
commit 4df25f23f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 10 deletions

View File

@ -5,7 +5,5 @@ extends EditorScenePostImport
# Called by the editor when a scene has this script set as the import script in the import tab. # Called by the editor when a scene has this script set as the import script in the import tab.
func _post_import(scene: Node) -> Object: func _post_import(scene: Node) -> Object:
# Modify the contents of the scene upon import. For example, setting up LODs: # Modify the contents of the scene upon import.
# (scene.get_node(^"HighPolyMesh") as MeshInstance3D).draw_distance_end = 5.0
# (scene.get_node(^"LowPolyMesh") as MeshInstance3D).draw_distance_begin = 5.0
return scene # Return the modified root node when you're done. return scene # Return the modified root node when you're done.

View File

@ -7,12 +7,10 @@ using System;
[Tool] [Tool]
public partial class _CLASS_ : _BASE_ public partial class _CLASS_ : _BASE_
{ {
public override Object _PostImport(Node scene) public override Godot.Object _PostImport(Node scene)
{ {
// Modify the contents of the scene upon import. For example, setting up LODs: // Modify the contents of the scene upon import.
// scene.GetNode<MeshInstance3D>("HighPolyMesh").DrawDistanceEnd = 5.0 return scene; // Return the modified root node when you're done.
// scene.GetNode<MeshInstance3D>("LowPolyMesh").DrawDistanceBegin = 5.0
return scene // Return the modified root node when you're done.
} }
} }
#endif #endif

View File

@ -7,9 +7,9 @@ using System;
[Tool] [Tool]
public partial class _CLASS_ : _BASE_ public partial class _CLASS_ : _BASE_
{ {
public override Object _PostImport(Node scene) public override Godot.Object _PostImport(Node scene)
{ {
return scene return scene;
} }
} }
#endif #endif