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

C#: Re-introduce generic Godot Array and Dictionary

This new version does not support the following type arguments:

- Generic types
- Array of Godot Object (Godot.Object[]) or derived types

The new implementation uses delegate pointers to call the Variant
conversion methods. We do type checking only once in the static
constructor to get the conversion delegates.
Now, we no longer need to do type checking every time, and we no
longer have to box value types.
This is the best implementation I could come up with, as C# generics
don't support anything similar to C++ template specializations.
This commit is contained in:
Ignacio Roldán Etcheverry
2022-08-08 01:53:54 +02:00
parent 3123be2384
commit 0c30c678f0
13 changed files with 1792 additions and 31 deletions

View File

@@ -55,7 +55,7 @@ public partial class VisualShaderNode_CLASS_ : _BASE_
return 0;
}
public override string _GetCode(Godot.Collections.Array inputVars, Godot.Collections.Array outputVars, Shader.Mode mode, VisualShader.Type type)
public override string _GetCode(Godot.Collections.Array<string> inputVars, Godot.Collections.Array<string> outputVars, Shader.Mode mode, VisualShader.Type type)
{
return "";
}