mirror of
https://github.com/godotengine/godot.git
synced 2025-10-31 21:51:22 +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:
parent
83cc5d4914
commit
12e4aa93b3
8 changed files with 195 additions and 14 deletions
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue