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

C#: Document generated members

Documents generated members and tries to discourage users from calling/overriding internal methods that only exist to be used by the engine.
This commit is contained in:
Raul Santos
2023-07-09 14:14:36 +02:00
parent 83cc5d4914
commit 12e4aa93b3
8 changed files with 195 additions and 14 deletions

View File

@@ -285,10 +285,20 @@ namespace Godot.SourceGenerators
{
source.Append("#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword\n");
string dictionaryType =
const string dictionaryType =
"global::System.Collections.Generic.Dictionary<global::Godot.StringName, global::Godot.Variant>";
source.Append("#if TOOLS\n");
source.Append(" /// <summary>\n")
.Append(" /// Get the default values for all properties declared in this class.\n")
.Append(" /// This method is used by Godot to determine the value that will be\n")
.Append(" /// used by the inspector when resetting properties.\n")
.Append(" /// Do not call this method.\n")
.Append(" /// </summary>\n");
source.Append(" [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]\n");
source.Append(" internal new static ");
source.Append(dictionaryType);
source.Append(" GetGodotPropertyDefaultValues()\n {\n");
@@ -320,7 +330,8 @@ namespace Godot.SourceGenerators
source.Append(" return values;\n");
source.Append(" }\n");
source.Append("#endif\n");
source.Append("#endif // TOOLS\n");
source.Append("#pragma warning restore CS0109\n");
}