1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Expose Script.get_global_name()

This commit is contained in:
Alfonso J. Ramos
2023-12-18 14:56:24 +01:00
committed by Yuri Sizov
parent 2d0ee20ff3
commit e7e35e8366
2 changed files with 23 additions and 0 deletions

View File

@@ -24,6 +24,27 @@
Returns the script directly inherited by this script.
</description>
</method>
<method name="get_global_name" qualifiers="const">
<return type="StringName" />
<description>
Returns the class name associated with the script, if there is one. Returns an empty string otherwise.
To give the script a global name, you can use the [code]class_name[/code] keyword in GDScript and the [code][GlobalClass][/code] attribute in C#.
[codeblocks]
[gdscript]
class_name MyNode
extends Node
[/gdscript]
[csharp]
using Godot;
[GlobalClass]
public partial class MyNode : Node
{
}
[/csharp]
[/codeblocks]
</description>
</method>
<method name="get_instance_base_type" qualifiers="const">
<return type="StringName" />
<description>